@7365admin1/core 2.6.4

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.
@@ -0,0 +1,4598 @@
1
+ import Joi from 'joi';
2
+ import * as mongodb from 'mongodb';
3
+ import { ObjectId, ClientSession, Db, Collection } from 'mongodb';
4
+ import { Request, Response, NextFunction } from 'express';
5
+ import * as bson from 'bson';
6
+ import { z } from 'zod';
7
+ import * as urllib from 'urllib';
8
+
9
+ type TSession = {
10
+ token: string;
11
+ user: string | ObjectId;
12
+ createdAt?: string;
13
+ };
14
+ type TSessionCreate = Pick<TSession, "token" | "user">;
15
+ declare const tokenSchema: Joi.ObjectSchema<any>;
16
+ declare function MSession(value: TSession): {
17
+ token: string;
18
+ user: string | ObjectId;
19
+ createdAt: string;
20
+ };
21
+
22
+ declare function useSessionRepo(): {
23
+ add: (value: TSessionCreate) => Promise<string>;
24
+ getByToken: (token: string) => Promise<any>;
25
+ deleteByToken: (token: string) => Promise<any>;
26
+ };
27
+
28
+ declare function useAuthService(): {
29
+ login: ({ email, password, }: {
30
+ email: string;
31
+ password: string;
32
+ }) => Promise<{
33
+ sid: string;
34
+ user: string;
35
+ }>;
36
+ refreshToken: (token: string) => Promise<string>;
37
+ logout: (sid: string) => Promise<string>;
38
+ verifyPassword: (_id: string | ObjectId, password: string) => Promise<string>;
39
+ };
40
+
41
+ declare function useAuthController(): {
42
+ login: (req: Request, res: Response, next: NextFunction) => Promise<void>;
43
+ refreshToken: (req: Request, res: Response, next: NextFunction) => Promise<void>;
44
+ logout: (req: Request, res: Response, next: NextFunction) => Promise<void>;
45
+ signUp: (req: Request, res: Response, next: NextFunction) => Promise<void>;
46
+ resetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
47
+ verifyPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
48
+ };
49
+
50
+ type TUser = {
51
+ _id?: ObjectId;
52
+ email: string;
53
+ password: string;
54
+ name: string;
55
+ defaultOrg?: string | ObjectId;
56
+ status?: string;
57
+ createdAt?: string;
58
+ updatedAt?: string;
59
+ deletedAt?: string;
60
+ };
61
+ type TUserCreate = Pick<TUser, "email" | "password" | "name">;
62
+ declare const userSchema: Joi.ObjectSchema<any>;
63
+ declare function MUser(value: TUser): {
64
+ email: string;
65
+ password: string;
66
+ name: string;
67
+ defaultOrg: string | ObjectId;
68
+ status: string;
69
+ createdAt: string;
70
+ updatedAt: string;
71
+ deletedAt: string;
72
+ };
73
+
74
+ declare function useUserRepo(): {
75
+ createIndex: () => Promise<void>;
76
+ createTextIndex: () => Promise<void>;
77
+ createUniqueIndex: () => Promise<void>;
78
+ createUser: (value: TUser, session?: ClientSession) => Promise<ObjectId>;
79
+ getUserByEmail: (email: string) => Promise<TUser | null>;
80
+ getUserByReferralCode: (referralCode: string) => Promise<TUser | null>;
81
+ getByEmailApp: (email: string, app: string) => Promise<TUser | null>;
82
+ getUserById: (_id: string | ObjectId) => Promise<TUser>;
83
+ getUsers: ({ search, page, limit, sort, type, status, }: {
84
+ search?: string | undefined;
85
+ page?: number | undefined;
86
+ limit?: number | undefined;
87
+ sort?: Record<string, any> | undefined;
88
+ type?: string | undefined;
89
+ status: string;
90
+ }) => Promise<{}>;
91
+ getUsersByOrgId: ({ organization, search, page, limit, sort, type, status, }: {
92
+ organization: string | ObjectId;
93
+ search?: string | undefined;
94
+ page?: number | undefined;
95
+ limit?: number | undefined;
96
+ sort?: Record<string, any> | undefined;
97
+ type?: string | undefined;
98
+ status: string;
99
+ }) => Promise<{}>;
100
+ updatePassword: ({ _id, password }: {
101
+ _id: string | ObjectId;
102
+ password: string;
103
+ }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
104
+ updateBirthday: ({ _id, month, day, year, }: {
105
+ _id: string | ObjectId;
106
+ month: string;
107
+ day: number;
108
+ year: number;
109
+ }, session?: ClientSession) => Promise<string>;
110
+ updateUserFieldById: ({ _id, field, value }?: {
111
+ _id: string | ObjectId;
112
+ field: string;
113
+ value: string | ObjectId;
114
+ }, session?: ClientSession) => Promise<string>;
115
+ updateDefaultOrgByEmail: (email: string, value: string, session?: ClientSession) => Promise<string>;
116
+ };
117
+
118
+ declare function useUserController(): {
119
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
120
+ getByEmail: (req: Request, res: Response, next: NextFunction) => Promise<void>;
121
+ getUsersByOrgId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
122
+ getUsers: (req: Request, res: Response, next: NextFunction) => Promise<void>;
123
+ createUserByVerification: (req: Request, res: Response, next: NextFunction) => Promise<void>;
124
+ updateUserProfile: (req: Request, res: Response, next: NextFunction) => Promise<void>;
125
+ updateBirthday: (req: Request, res: Response, next: NextFunction) => Promise<void>;
126
+ updateUserFieldById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
127
+ updatePasswordById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
128
+ };
129
+
130
+ declare function useUserService(): {
131
+ createDefaultUser: () => Promise<void>;
132
+ createUserBySignUp: ({ id, name, password, }?: {
133
+ id?: string | undefined;
134
+ name?: string | undefined;
135
+ password?: string | undefined;
136
+ }) => Promise<bson.ObjectId>;
137
+ resetPassword: (id: string, newPassword: string, passwordConfirmation: string) => Promise<string>;
138
+ updateUserProfile: ({ file, user, previousProfile, }: {
139
+ file: Express.Multer.File;
140
+ user: string;
141
+ previousProfile?: string | undefined;
142
+ }) => Promise<string>;
143
+ updatePasswordById: (id: string, currentPassword: string, newPassword: string, passwordConfirmation: string) => Promise<mongodb.UpdateResult<bson.Document>>;
144
+ };
145
+
146
+ type TRole = {
147
+ _id?: ObjectId;
148
+ name?: string;
149
+ description?: string;
150
+ permissions?: Array<string>;
151
+ type?: string;
152
+ org?: string | ObjectId;
153
+ default?: boolean;
154
+ status?: string;
155
+ createdBy?: string | ObjectId;
156
+ createdAt?: string;
157
+ updatedAt?: string;
158
+ deletedAt?: string;
159
+ };
160
+ type TMiniRole = Pick<TRole, "name" | "permissions">;
161
+ declare class MRole implements TRole {
162
+ _id: ObjectId;
163
+ name?: string;
164
+ description?: string;
165
+ permissions?: Array<string>;
166
+ type?: string;
167
+ org: string | ObjectId;
168
+ default?: boolean;
169
+ status?: string;
170
+ createdBy?: string | ObjectId;
171
+ createdAt?: string;
172
+ updatedAt?: string;
173
+ deletedAt?: string;
174
+ constructor(value: TRole);
175
+ }
176
+
177
+ declare function useRoleRepo(): {
178
+ createIndex: () => Promise<void>;
179
+ createTextIndex: () => Promise<void>;
180
+ createUniqueIndex: () => Promise<void>;
181
+ addRole: (value: TRole, session?: ClientSession) => Promise<ObjectId>;
182
+ getRoleByUserId: (value: string | ObjectId) => Promise<TRole | null>;
183
+ getRoleById: (_id: string | ObjectId) => Promise<TRole | null>;
184
+ getRoleByName: (name: string) => Promise<TRole | null>;
185
+ getRoles: ({ search, page, limit, sort, type, org, }: {
186
+ search?: string | undefined;
187
+ page?: number | undefined;
188
+ limit?: number | undefined;
189
+ sort?: any;
190
+ type?: string | undefined;
191
+ org: string | ObjectId;
192
+ }) => Promise<{}>;
193
+ updateRole: (_id: string | ObjectId, value: TMiniRole, session?: ClientSession) => Promise<ObjectId>;
194
+ updatePermissionsById: (_id: string | ObjectId, permissions: TRole["permissions"], session?: ClientSession) => Promise<string>;
195
+ deleteRole: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
196
+ getOwnerRolesByTypeOrg: (type: string, org: string | ObjectId) => Promise<TRole[]>;
197
+ };
198
+
199
+ declare function useRoleController(): {
200
+ createRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
201
+ getRoles: (req: Request, res: Response, next: NextFunction) => Promise<void>;
202
+ getRoleByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
203
+ getRoleById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
204
+ updateRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
205
+ updatePermissionsById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
206
+ deleteRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
207
+ };
208
+
209
+ type TMember = {
210
+ _id?: ObjectId;
211
+ name: string;
212
+ user: string | ObjectId;
213
+ type: string;
214
+ role: string | ObjectId;
215
+ org?: string | ObjectId;
216
+ orgName?: string;
217
+ siteId?: string | ObjectId;
218
+ siteName?: string;
219
+ status?: string;
220
+ createdAt?: string;
221
+ updatedAt?: string;
222
+ deletedAt?: string;
223
+ };
224
+ type TUpdateName = Pick<TMember, "user" | "name">;
225
+ type TMemberUpdateStatus = {
226
+ status: NonNullable<TMember["status"]>;
227
+ };
228
+ declare function MMember(value: TMember): TMember;
229
+
230
+ declare function useMemberRepo(): {
231
+ createIndex: () => Promise<void>;
232
+ createUniqueIndex: () => Promise<void>;
233
+ createTextIndex: () => Promise<void>;
234
+ add: (value: TMember, session?: ClientSession) => Promise<string>;
235
+ getById: (_id: string | ObjectId) => Promise<TMember>;
236
+ getByUserId: (user: string | ObjectId) => Promise<TMember>;
237
+ getByUserIdType: (user: string | ObjectId, type: string) => Promise<TMember>;
238
+ getByRoleId: (role: string | ObjectId) => Promise<any>;
239
+ getAll: ({ search, page, limit, user, org, type, status, }: {
240
+ search?: string | undefined;
241
+ page?: number | undefined;
242
+ limit?: number | undefined;
243
+ user?: string | ObjectId | undefined;
244
+ org?: string | ObjectId | undefined;
245
+ type: string;
246
+ status: string;
247
+ }) => Promise<{
248
+ items: any[];
249
+ pages: number;
250
+ pageRange: string;
251
+ } | TMember>;
252
+ getOrgsByMembership: ({ search, page, limit, user, type, }: {
253
+ search?: string | undefined;
254
+ page?: number | undefined;
255
+ limit?: number | undefined;
256
+ user?: string | ObjectId | undefined;
257
+ type?: string | undefined;
258
+ }) => Promise<{
259
+ items: any[];
260
+ pages: number;
261
+ pageRange: string;
262
+ } | TMember>;
263
+ getOrgsByUserId: ({ search, page, limit, sort, user, status, }: {
264
+ search?: string | undefined;
265
+ page?: number | undefined;
266
+ limit?: number | undefined;
267
+ sort?: Record<string, number> | undefined;
268
+ user: string | ObjectId;
269
+ status: string;
270
+ }) => Promise<{
271
+ items: any[];
272
+ pages: number;
273
+ pageRange: string;
274
+ } | TMember>;
275
+ updateName: (value: TUpdateName, session?: ClientSession) => Promise<string>;
276
+ updateStatusByUserId: (user: string | ObjectId, status: string) => Promise<string>;
277
+ updateMemberStatus: (_id: string | ObjectId, value: TMemberUpdateStatus) => Promise<number>;
278
+ countByOrg: (org: string | ObjectId) => Promise<number | TMember>;
279
+ countUserMembershipById: (user: string | ObjectId) => Promise<number | TMember>;
280
+ updateRoleById: (_id: string | ObjectId, role: string | ObjectId) => Promise<number>;
281
+ getByRoles: (roles: string[] | ObjectId[], type: string) => Promise<TMember[]>;
282
+ };
283
+
284
+ declare function useMemberController(): {
285
+ createMember: (req: Request, res: Response, next: NextFunction) => Promise<void>;
286
+ getByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
287
+ getByUserIdType: (req: Request, res: Response, next: NextFunction) => Promise<void>;
288
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
289
+ getOrgsByMembership: (req: Request, res: Response, next: NextFunction) => Promise<void>;
290
+ updateMemberStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
291
+ updateRoleById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
292
+ };
293
+
294
+ type TVerificationMetadata = {
295
+ name?: string;
296
+ app?: string;
297
+ role?: string | ObjectId;
298
+ referralCode?: string;
299
+ org?: string | ObjectId;
300
+ orgNature?: string;
301
+ siteId?: string | ObjectId;
302
+ siteName?: string;
303
+ serviceProviderOrgId?: string | ObjectId;
304
+ };
305
+ type TVerification = {
306
+ _id?: ObjectId;
307
+ type: string;
308
+ email: string;
309
+ metadata?: TVerificationMetadata;
310
+ status?: string;
311
+ createdAt: string;
312
+ updatedAt?: string | null;
313
+ expireAt: string;
314
+ };
315
+ declare class MVerification implements TVerification {
316
+ _id?: ObjectId;
317
+ type: string;
318
+ email: string;
319
+ metadata?: TVerificationMetadata;
320
+ status?: string;
321
+ createdAt: string;
322
+ updatedAt?: string | null;
323
+ expireAt: string;
324
+ constructor(value: TVerification);
325
+ }
326
+
327
+ declare function useVerificationRepo(): {
328
+ createIndex: () => Promise<void>;
329
+ createTextIndex: () => Promise<void>;
330
+ add: (value: TVerification, session?: ClientSession) => Promise<ObjectId>;
331
+ getById: (_id: string | ObjectId) => Promise<TVerification | null>;
332
+ getVerifications: ({ search, page, limit, sort, status, app, type, email, }: {
333
+ search?: string | undefined;
334
+ page?: number | undefined;
335
+ limit?: number | undefined;
336
+ sort?: Record<string, any> | undefined;
337
+ status: string;
338
+ app?: string | undefined;
339
+ type?: Record<string, any> | undefined;
340
+ email?: string | undefined;
341
+ }) => Promise<{}>;
342
+ getByIdByType: (type: string) => Promise<TVerification[]>;
343
+ updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
344
+ };
345
+
346
+ type TKeyValuePair<K extends string | number | symbol = string, V = any> = {
347
+ [key in K]: V;
348
+ };
349
+
350
+ declare function useVerificationService(): {
351
+ createUserInvite: ({ email, metadata, }: {
352
+ email: string;
353
+ metadata: TKeyValuePair;
354
+ }) => Promise<bson.ObjectId>;
355
+ createForgetPassword: (email: string) => Promise<string>;
356
+ createServiceProviderInvite: ({ email, orgId, siteId, siteName, }: {
357
+ email: string;
358
+ orgId: string;
359
+ siteId: string;
360
+ siteName: string;
361
+ }) => Promise<bson.ObjectId>;
362
+ getById: (id: string) => Promise<TVerification>;
363
+ verify: (id: string) => Promise<TVerification>;
364
+ cancelUserInvitation: (id: string) => Promise<void>;
365
+ updateStatusById: (_id: string, status: string) => Promise<string>;
366
+ signUp: ({ email, metadata, }: {
367
+ email: string;
368
+ metadata: TKeyValuePair;
369
+ }) => Promise<bson.ObjectId>;
370
+ };
371
+
372
+ declare function useVerificationController(): {
373
+ getVerifications: (req: Request, res: Response, next: NextFunction) => Promise<void>;
374
+ createUserInvite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
375
+ createServiceProviderInvite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
376
+ createForgetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
377
+ verify: (req: Request, res: Response, next: NextFunction) => Promise<void>;
378
+ cancelUserInvitation: (req: Request, res: Response, next: NextFunction) => Promise<void>;
379
+ };
380
+
381
+ type TFile = {
382
+ _id?: ObjectId;
383
+ name: string;
384
+ type?: string;
385
+ status?: string;
386
+ createdAt: string;
387
+ };
388
+ declare class MFile implements TFile {
389
+ _id?: ObjectId;
390
+ name: string;
391
+ type?: string;
392
+ status?: string;
393
+ createdAt: string;
394
+ constructor(value: TFile);
395
+ }
396
+
397
+ declare function useFileRepo(): {
398
+ createFile: (value: TFile, session?: ClientSession) => Promise<string>;
399
+ deleteFileById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
400
+ getAllDraftedFiles: () => Promise<mongodb.WithId<bson.Document>[] | TFile>;
401
+ updateStatusById: (_id: string | ObjectId, value: Pick<TFile, "status">, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
402
+ getFileById: (_id: string | ObjectId) => Promise<TFile | null>;
403
+ };
404
+
405
+ declare function useFileService(): {
406
+ createFile: (value: Express.Multer.File, folder?: string) => Promise<string>;
407
+ deleteFile: (id: string) => Promise<string>;
408
+ deleteDraft: () => void;
409
+ };
410
+
411
+ declare function useFileController(): {
412
+ upload: (req: Request, res: Response, next: NextFunction) => Promise<void>;
413
+ deleteFile: (req: Request, res: Response, next: NextFunction) => Promise<void>;
414
+ getFileById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
415
+ };
416
+
417
+ type TOrg = {
418
+ _id?: ObjectId;
419
+ name: string;
420
+ description?: string;
421
+ type: string;
422
+ nature: string;
423
+ email?: string;
424
+ contact?: string;
425
+ busInst?: string;
426
+ status?: string;
427
+ defaultSite?: string;
428
+ createdAt?: string | Date;
429
+ updatedAt?: string | Date;
430
+ deletedAt?: string | Date;
431
+ };
432
+ declare const allowedNatures: string[];
433
+ declare const orgSchema: Joi.ObjectSchema<any>;
434
+ declare function MOrg(value: TOrg): TOrg;
435
+
436
+ declare function useOrgRepo(): {
437
+ createIndex: () => Promise<void>;
438
+ createTextIndex: () => Promise<void>;
439
+ createUniqueIndex: () => Promise<void>;
440
+ add: (value: TOrg, session?: ClientSession) => Promise<ObjectId>;
441
+ getAll: ({ search, page, limit, sort, status, nature, }: {
442
+ search?: string | undefined;
443
+ page?: number | undefined;
444
+ limit?: number | undefined;
445
+ sort?: Record<string, number> | undefined;
446
+ status?: string | undefined;
447
+ nature?: string | undefined;
448
+ }) => Promise<{
449
+ items: any[];
450
+ pages: number;
451
+ pageRange: string;
452
+ } | TOrg>;
453
+ getById: (_id: string | ObjectId) => Promise<TOrg>;
454
+ getByName: (name: string) => Promise<TOrg>;
455
+ getByEmail: (email: string) => Promise<TOrg | null>;
456
+ updateFieldById: ({ _id, field, value, }: {
457
+ _id: string | ObjectId;
458
+ field: string;
459
+ value: string;
460
+ }, session?: ClientSession) => Promise<string>;
461
+ deleteById: (_id: string | ObjectId) => Promise<string>;
462
+ };
463
+
464
+ declare function useOrgController(): {
465
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
466
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
467
+ getOrgsByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
468
+ getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
469
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
470
+ getByEmail: (req: Request, res: Response, next: NextFunction) => Promise<void>;
471
+ };
472
+
473
+ type TSubscription = {
474
+ _id?: ObjectId;
475
+ user?: string | ObjectId;
476
+ org?: string | ObjectId;
477
+ amount: number;
478
+ description?: string;
479
+ currency: string;
480
+ promoCode?: string;
481
+ type: string;
482
+ paidSeats?: number;
483
+ currentSeats?: number;
484
+ maxSeats?: number;
485
+ status?: string;
486
+ billingCycle: "monthly" | "yearly";
487
+ nextBillingDate?: Date;
488
+ lastPaymentStatus?: string;
489
+ failedAttempts?: number;
490
+ createdAt?: string;
491
+ updatedAt?: string;
492
+ deletedAt?: string;
493
+ };
494
+ declare const schema: Joi.ObjectSchema<any>;
495
+ declare function MSubscription(value: TSubscription): TSubscription;
496
+
497
+ declare function useSubscriptionRepo(): {
498
+ createIndex: () => Promise<void>;
499
+ createUniqueIndex: () => Promise<void>;
500
+ add: (value: TSubscription, session?: ClientSession) => Promise<ObjectId>;
501
+ getById: (_id: string | ObjectId) => Promise<TSubscription | null>;
502
+ getByUserId: (user: string | ObjectId) => Promise<TSubscription | null>;
503
+ getByAffiliateUserId: (user: string | ObjectId) => Promise<TSubscription | null>;
504
+ getByOrgId: (org: string | ObjectId) => Promise<TSubscription | null>;
505
+ getBySubscriptionId: (subscriptionId: string) => Promise<TSubscription | null>;
506
+ getSubscriptions: ({ search, page, limit, sort, status, }: {
507
+ search?: string | undefined;
508
+ page?: number | undefined;
509
+ limit?: number | undefined;
510
+ sort?: Record<string, any> | undefined;
511
+ status: string;
512
+ }) => Promise<{}>;
513
+ updateStatus: (_id: string | ObjectId, status: string) => Promise<string>;
514
+ getDueSubscriptions: (BATCH_SIZE?: number) => Promise<TSubscription[]>;
515
+ getFailedSubscriptions: (BATCH_SIZE?: number) => Promise<{}>;
516
+ processSuccessfulPayment: (value: Pick<TSubscription, "nextBillingDate"> & {
517
+ _id: string | ObjectId;
518
+ }, session?: ClientSession) => Promise<string>;
519
+ markSubscriptionAsFailed: ({ _id, failed }: {
520
+ _id: string | ObjectId;
521
+ failed?: boolean | undefined;
522
+ }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
523
+ markSubscriptionAsCanceled: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
524
+ updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
525
+ updateSeatsById: ({ _id, currentSeats, maxSeats, paidSeats, amount, promoCode, }: {
526
+ _id: string | ObjectId;
527
+ currentSeats: number;
528
+ maxSeats: number;
529
+ paidSeats?: number | undefined;
530
+ amount: number;
531
+ promoCode?: string | undefined;
532
+ }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
533
+ updateMaxSeatsById: ({ _id, seats, }: {
534
+ _id: string | ObjectId;
535
+ seats: number;
536
+ }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
537
+ };
538
+
539
+ type TAddress = {
540
+ _id?: ObjectId;
541
+ type: string;
542
+ user: string | ObjectId;
543
+ org?: string | ObjectId;
544
+ country: string;
545
+ address: string;
546
+ continuedAddress?: string;
547
+ city: string;
548
+ province: string;
549
+ postalCode: string;
550
+ taxId: string;
551
+ };
552
+
553
+ declare function useSubscriptionService(): {
554
+ createOrgSubscription: (value: {
555
+ user: string;
556
+ amount: number;
557
+ currency: string;
558
+ promoCode?: string | undefined;
559
+ payment_method_id: string;
560
+ payment_method_expiry_month?: string | undefined;
561
+ payment_method_expiry_year?: string | undefined;
562
+ payment_method_cvv?: string | undefined;
563
+ payment_method_cardholder_name?: string | undefined;
564
+ payment_method_channel: string;
565
+ payment_method_type: string;
566
+ customer_id: string;
567
+ organization: TOrg;
568
+ billingAddress: TAddress;
569
+ seats: number;
570
+ }) => Promise<{
571
+ message: string;
572
+ data: {
573
+ org: string;
574
+ };
575
+ }>;
576
+ processSubscriptions: (batchSize?: number, maxRetries?: number) => Promise<void>;
577
+ updateSeatsById: (value: {
578
+ subscriptionId: string;
579
+ seats: number;
580
+ promoCode?: string | undefined;
581
+ amount: number;
582
+ }) => Promise<void>;
583
+ };
584
+
585
+ declare function useSubscriptionController(): {
586
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
587
+ getByOrgId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
588
+ getSubscriptions: (req: Request, res: Response, next: NextFunction) => Promise<void>;
589
+ createOrgSubscription: (req: Request, res: Response, next: NextFunction) => Promise<void>;
590
+ updateSubscriptionSeats: (req: Request, res: Response, next: NextFunction) => Promise<void>;
591
+ };
592
+
593
+ declare const TPriceType: z.ZodEnum<["monthly-subscription", "yearly-subscription", "one-time-payment", "other"]>;
594
+ type TPriceType = z.infer<typeof TPriceType>;
595
+ declare const TPrice: z.ZodObject<{
596
+ _id: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>, ObjectId | undefined, string | ObjectId | undefined>;
597
+ value: z.ZodDefault<z.ZodNumber>;
598
+ saleValue: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
599
+ saleExpiry: z.ZodOptional<z.ZodDate>;
600
+ name: z.ZodString;
601
+ type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["monthly-subscription", "yearly-subscription", "one-time-payment", "other"]>>>;
602
+ createdAt: z.ZodOptional<z.ZodDefault<z.ZodDate>>;
603
+ updatedAt: z.ZodOptional<z.ZodDate>;
604
+ deletedAt: z.ZodOptional<z.ZodDate>;
605
+ }, "strip", z.ZodTypeAny, {
606
+ name: string;
607
+ value: number;
608
+ type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
609
+ createdAt?: Date | undefined;
610
+ _id?: ObjectId | undefined;
611
+ updatedAt?: Date | undefined;
612
+ deletedAt?: Date | undefined;
613
+ saleValue?: number | undefined;
614
+ saleExpiry?: Date | undefined;
615
+ }, {
616
+ name: string;
617
+ createdAt?: Date | undefined;
618
+ _id?: string | ObjectId | undefined;
619
+ updatedAt?: Date | undefined;
620
+ deletedAt?: Date | undefined;
621
+ value?: number | undefined;
622
+ type?: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription" | undefined;
623
+ saleValue?: number | undefined;
624
+ saleExpiry?: Date | undefined;
625
+ }>;
626
+ type TPrice = z.infer<typeof TPrice>;
627
+ declare function usePriceModel(db: Db): {
628
+ createPrice: (value: Pick<TPrice, "type" | "name" | "value">) => {
629
+ name: string;
630
+ value: number;
631
+ type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
632
+ createdAt?: Date | undefined;
633
+ _id?: ObjectId | undefined;
634
+ updatedAt?: Date | undefined;
635
+ deletedAt?: Date | undefined;
636
+ saleValue?: number | undefined;
637
+ saleExpiry?: Date | undefined;
638
+ };
639
+ validatePrice: (data: unknown) => z.SafeParseReturnType<{
640
+ name: string;
641
+ createdAt?: Date | undefined;
642
+ _id?: string | ObjectId | undefined;
643
+ updatedAt?: Date | undefined;
644
+ deletedAt?: Date | undefined;
645
+ value?: number | undefined;
646
+ type?: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription" | undefined;
647
+ saleValue?: number | undefined;
648
+ saleExpiry?: Date | undefined;
649
+ }, {
650
+ name: string;
651
+ value: number;
652
+ type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
653
+ createdAt?: Date | undefined;
654
+ _id?: ObjectId | undefined;
655
+ updatedAt?: Date | undefined;
656
+ deletedAt?: Date | undefined;
657
+ saleValue?: number | undefined;
658
+ saleExpiry?: Date | undefined;
659
+ }>;
660
+ collection: Collection<{
661
+ name: string;
662
+ value: number;
663
+ type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
664
+ createdAt?: Date | undefined;
665
+ _id?: ObjectId | undefined;
666
+ updatedAt?: Date | undefined;
667
+ deletedAt?: Date | undefined;
668
+ saleValue?: number | undefined;
669
+ saleExpiry?: Date | undefined;
670
+ }>;
671
+ collection_name: string;
672
+ };
673
+
674
+ declare function usePriceRepo(): {
675
+ createIndex: () => Promise<void>;
676
+ createUniqueIndex: () => Promise<void>;
677
+ add: (value: Pick<TPrice, "type" | "name" | "value">) => Promise<void>;
678
+ setSaleValueByType: (value: Pick<TPrice, "type" | "saleValue" | "saleExpiry">, session?: ClientSession) => Promise<void>;
679
+ getByNameType: (name: string, type: TPriceType) => Promise<TPrice>;
680
+ };
681
+
682
+ declare function usePriceController(): {
683
+ getByNameType: (req: Request, res: Response, next: NextFunction) => Promise<void>;
684
+ };
685
+
686
+ declare const TCounter: z.ZodObject<{
687
+ _id: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>, ObjectId, string | ObjectId>>;
688
+ count: z.ZodDefault<z.ZodNumber>;
689
+ type: z.ZodString;
690
+ createdAt: z.ZodDefault<z.ZodOptional<z.ZodDate>>;
691
+ updatedAt: z.ZodOptional<z.ZodDate>;
692
+ deletedAt: z.ZodOptional<z.ZodDate>;
693
+ }, "strip", z.ZodTypeAny, {
694
+ createdAt: Date;
695
+ type: string;
696
+ count: number;
697
+ _id?: ObjectId | undefined;
698
+ updatedAt?: Date | undefined;
699
+ deletedAt?: Date | undefined;
700
+ }, {
701
+ type: string;
702
+ createdAt?: Date | undefined;
703
+ _id?: string | ObjectId | undefined;
704
+ updatedAt?: Date | undefined;
705
+ deletedAt?: Date | undefined;
706
+ count?: number | undefined;
707
+ }>;
708
+ type TCounter = z.infer<typeof TCounter>;
709
+ declare function useCounterModel(db: Db): {
710
+ createCounter: (value: Pick<TCounter, "type">) => {
711
+ createdAt: Date;
712
+ type: string;
713
+ count: number;
714
+ _id?: ObjectId | undefined;
715
+ updatedAt?: Date | undefined;
716
+ deletedAt?: Date | undefined;
717
+ };
718
+ validateCounter: (data: unknown) => z.SafeParseReturnType<{
719
+ type: string;
720
+ createdAt?: Date | undefined;
721
+ _id?: string | ObjectId | undefined;
722
+ updatedAt?: Date | undefined;
723
+ deletedAt?: Date | undefined;
724
+ count?: number | undefined;
725
+ }, {
726
+ createdAt: Date;
727
+ type: string;
728
+ count: number;
729
+ _id?: ObjectId | undefined;
730
+ updatedAt?: Date | undefined;
731
+ deletedAt?: Date | undefined;
732
+ }>;
733
+ collection: Collection<{
734
+ createdAt: Date;
735
+ type: string;
736
+ count: number;
737
+ _id?: ObjectId | undefined;
738
+ updatedAt?: Date | undefined;
739
+ deletedAt?: Date | undefined;
740
+ }>;
741
+ };
742
+
743
+ declare function useCounterRepo(): {
744
+ createIndex: () => Promise<void>;
745
+ createUniqueIndex: () => Promise<void>;
746
+ add: (type: string) => Promise<mongodb.InsertOneResult<{
747
+ createdAt: Date;
748
+ type: string;
749
+ count: number;
750
+ _id?: bson.ObjectId | undefined;
751
+ updatedAt?: Date | undefined;
752
+ deletedAt?: Date | undefined;
753
+ }>>;
754
+ incrementByType: (type: string, session?: ClientSession) => Promise<void>;
755
+ incrementCounterByType: (type: string, session?: ClientSession) => Promise<{
756
+ createdAt: Date;
757
+ type: string;
758
+ count: number;
759
+ _id?: bson.ObjectId | undefined;
760
+ updatedAt?: Date | undefined;
761
+ deletedAt?: Date | undefined;
762
+ }>;
763
+ getByType: (type: string) => Promise<{
764
+ createdAt: Date;
765
+ type: string;
766
+ count: number;
767
+ _id?: bson.ObjectId | undefined;
768
+ updatedAt?: Date | undefined;
769
+ deletedAt?: Date | undefined;
770
+ } | null>;
771
+ };
772
+
773
+ declare const TInvoice: z.ZodObject<{
774
+ _id: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>, ObjectId | undefined, string | ObjectId | undefined>;
775
+ invoiceNumber: z.ZodString;
776
+ type: z.ZodDefault<z.ZodEnum<["organization-subscription", "affiliate-subscription", "one-time-payment", "other"]>>;
777
+ amount: z.ZodNumber;
778
+ dueDate: z.ZodDate;
779
+ status: z.ZodDefault<z.ZodEnum<["pending", "paid", "overdue", "cancelled"]>>;
780
+ items: z.ZodArray<z.ZodObject<{
781
+ description: z.ZodString;
782
+ unitPrice: z.ZodNumber;
783
+ quantity: z.ZodNumber;
784
+ seats: z.ZodOptional<z.ZodNumber>;
785
+ total: z.ZodNumber;
786
+ }, "strip", z.ZodTypeAny, {
787
+ description: string;
788
+ unitPrice: number;
789
+ quantity: number;
790
+ total: number;
791
+ seats?: number | undefined;
792
+ }, {
793
+ description: string;
794
+ unitPrice: number;
795
+ quantity: number;
796
+ total: number;
797
+ seats?: number | undefined;
798
+ }>, "many">;
799
+ metadata: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodObject<{
800
+ userId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
801
+ orgId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
802
+ billingCycle: z.ZodOptional<z.ZodEnum<["monthly", "yearly", "quarterly"]>>;
803
+ subscriptionId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
804
+ currency: z.ZodOptional<z.ZodDefault<z.ZodString>>;
805
+ description: z.ZodOptional<z.ZodString>;
806
+ }, "strip", z.ZodTypeAny, {
807
+ description?: string | undefined;
808
+ userId?: string | ObjectId | undefined;
809
+ orgId?: string | ObjectId | undefined;
810
+ currency?: string | undefined;
811
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
812
+ subscriptionId?: string | ObjectId | undefined;
813
+ }, {
814
+ description?: string | undefined;
815
+ userId?: string | ObjectId | undefined;
816
+ orgId?: string | ObjectId | undefined;
817
+ currency?: string | undefined;
818
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
819
+ subscriptionId?: string | ObjectId | undefined;
820
+ }>>>, {
821
+ description?: string | undefined;
822
+ userId?: string | ObjectId | undefined;
823
+ orgId?: string | ObjectId | undefined;
824
+ currency?: string | undefined;
825
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
826
+ subscriptionId?: string | ObjectId | undefined;
827
+ } | undefined, {
828
+ description?: string | undefined;
829
+ userId?: string | ObjectId | undefined;
830
+ orgId?: string | ObjectId | undefined;
831
+ currency?: string | undefined;
832
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
833
+ subscriptionId?: string | ObjectId | undefined;
834
+ } | undefined>;
835
+ descriptions: z.ZodOptional<z.ZodString>;
836
+ createdAt: z.ZodOptional<z.ZodDefault<z.ZodDate>>;
837
+ updatedAt: z.ZodOptional<z.ZodDate>;
838
+ }, "strip", z.ZodTypeAny, {
839
+ status: "pending" | "cancelled" | "paid" | "overdue";
840
+ type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
841
+ amount: number;
842
+ invoiceNumber: string;
843
+ dueDate: Date;
844
+ items: {
845
+ description: string;
846
+ unitPrice: number;
847
+ quantity: number;
848
+ total: number;
849
+ seats?: number | undefined;
850
+ }[];
851
+ createdAt?: Date | undefined;
852
+ _id?: ObjectId | undefined;
853
+ updatedAt?: Date | undefined;
854
+ metadata?: {
855
+ description?: string | undefined;
856
+ userId?: string | ObjectId | undefined;
857
+ orgId?: string | ObjectId | undefined;
858
+ currency?: string | undefined;
859
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
860
+ subscriptionId?: string | ObjectId | undefined;
861
+ } | undefined;
862
+ descriptions?: string | undefined;
863
+ }, {
864
+ amount: number;
865
+ invoiceNumber: string;
866
+ dueDate: Date;
867
+ items: {
868
+ description: string;
869
+ unitPrice: number;
870
+ quantity: number;
871
+ total: number;
872
+ seats?: number | undefined;
873
+ }[];
874
+ createdAt?: Date | undefined;
875
+ _id?: string | ObjectId | undefined;
876
+ status?: "pending" | "cancelled" | "paid" | "overdue" | undefined;
877
+ updatedAt?: Date | undefined;
878
+ metadata?: {
879
+ description?: string | undefined;
880
+ userId?: string | ObjectId | undefined;
881
+ orgId?: string | ObjectId | undefined;
882
+ currency?: string | undefined;
883
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
884
+ subscriptionId?: string | ObjectId | undefined;
885
+ } | undefined;
886
+ type?: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other" | undefined;
887
+ descriptions?: string | undefined;
888
+ }>;
889
+ type TInvoice = z.infer<typeof TInvoice>;
890
+ declare function useInvoiceModel(db: Db): {
891
+ createInvoice: (data: TInvoice) => TInvoice;
892
+ collection: Collection<{
893
+ status: "pending" | "cancelled" | "paid" | "overdue";
894
+ type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
895
+ amount: number;
896
+ invoiceNumber: string;
897
+ dueDate: Date;
898
+ items: {
899
+ description: string;
900
+ unitPrice: number;
901
+ quantity: number;
902
+ total: number;
903
+ seats?: number | undefined;
904
+ }[];
905
+ createdAt?: Date | undefined;
906
+ _id?: ObjectId | undefined;
907
+ updatedAt?: Date | undefined;
908
+ metadata?: {
909
+ description?: string | undefined;
910
+ userId?: string | ObjectId | undefined;
911
+ orgId?: string | ObjectId | undefined;
912
+ currency?: string | undefined;
913
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
914
+ subscriptionId?: string | ObjectId | undefined;
915
+ } | undefined;
916
+ descriptions?: string | undefined;
917
+ }>;
918
+ };
919
+
920
+ declare function useInvoiceRepo(): {
921
+ createIndex: () => Promise<void>;
922
+ createUniqueIndex: () => Promise<void>;
923
+ add: (value: TInvoice, session?: ClientSession) => Promise<void>;
924
+ getByDueDate: (dueDate: Date, status?: TInvoice["status"]) => Promise<{
925
+ status: "pending" | "cancelled" | "paid" | "overdue";
926
+ type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
927
+ amount: number;
928
+ invoiceNumber: string;
929
+ dueDate: Date;
930
+ items: {
931
+ description: string;
932
+ unitPrice: number;
933
+ quantity: number;
934
+ total: number;
935
+ seats?: number | undefined;
936
+ }[];
937
+ createdAt?: Date | undefined;
938
+ _id?: ObjectId | undefined;
939
+ updatedAt?: Date | undefined;
940
+ metadata?: {
941
+ description?: string | undefined;
942
+ userId?: string | ObjectId | undefined;
943
+ orgId?: string | ObjectId | undefined;
944
+ currency?: string | undefined;
945
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
946
+ subscriptionId?: string | ObjectId | undefined;
947
+ } | undefined;
948
+ descriptions?: string | undefined;
949
+ } | null>;
950
+ getBySubscriptionId: ({ id, search, page, limit, sort, }: {
951
+ id: string | ObjectId;
952
+ search?: string | undefined;
953
+ page?: number | undefined;
954
+ limit?: number | undefined;
955
+ sort?: Record<string, any> | undefined;
956
+ }) => Promise<{
957
+ items: any[];
958
+ pages: number;
959
+ pageRange: string;
960
+ } | {
961
+ status: "pending" | "cancelled" | "paid" | "overdue";
962
+ type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
963
+ amount: number;
964
+ invoiceNumber: string;
965
+ dueDate: Date;
966
+ items: {
967
+ description: string;
968
+ unitPrice: number;
969
+ quantity: number;
970
+ total: number;
971
+ seats?: number | undefined;
972
+ }[];
973
+ createdAt?: Date | undefined;
974
+ _id?: ObjectId | undefined;
975
+ updatedAt?: Date | undefined;
976
+ metadata?: {
977
+ description?: string | undefined;
978
+ userId?: string | ObjectId | undefined;
979
+ orgId?: string | ObjectId | undefined;
980
+ currency?: string | undefined;
981
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
982
+ subscriptionId?: string | ObjectId | undefined;
983
+ } | undefined;
984
+ descriptions?: string | undefined;
985
+ }>;
986
+ getOverdueInvoices: (BATCH_SIZE?: number) => Promise<{
987
+ status: "pending" | "cancelled" | "paid" | "overdue";
988
+ type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
989
+ amount: number;
990
+ invoiceNumber: string;
991
+ dueDate: Date;
992
+ items: {
993
+ description: string;
994
+ unitPrice: number;
995
+ quantity: number;
996
+ total: number;
997
+ seats?: number | undefined;
998
+ }[];
999
+ createdAt?: Date | undefined;
1000
+ _id?: ObjectId | undefined;
1001
+ updatedAt?: Date | undefined;
1002
+ metadata?: {
1003
+ description?: string | undefined;
1004
+ userId?: string | ObjectId | undefined;
1005
+ orgId?: string | ObjectId | undefined;
1006
+ currency?: string | undefined;
1007
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1008
+ subscriptionId?: string | ObjectId | undefined;
1009
+ } | undefined;
1010
+ descriptions?: string | undefined;
1011
+ }[]>;
1012
+ updateStatusByInvoiceNumber: (invoiceNumber: string, status: TInvoice["status"], session?: ClientSession) => Promise<void>;
1013
+ };
1014
+
1015
+ declare function useInvoiceController(): {
1016
+ getBySubscriptionId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1017
+ };
1018
+
1019
+ type TPromoType = "tiered" | "fixed";
1020
+ type TPromoTier = {
1021
+ min: number;
1022
+ max: number;
1023
+ price: number;
1024
+ };
1025
+ type TPromoCode = {
1026
+ _id?: ObjectId;
1027
+ code: string;
1028
+ description?: string;
1029
+ type: TPromoType;
1030
+ tiers?: TPromoTier[];
1031
+ fixed_rate?: number;
1032
+ appliesTo?: string;
1033
+ createdAt?: string;
1034
+ expiresAt?: string;
1035
+ assignedTo?: string | ObjectId;
1036
+ status?: "active" | "expired" | "disabled";
1037
+ };
1038
+
1039
+ declare const promoCodeSchema: Joi.ObjectSchema<any>;
1040
+ declare function MPromoCode(data: TPromoCode): TPromoCode;
1041
+
1042
+ declare function usePromoCodeRepo(): {
1043
+ createIndex: () => Promise<void>;
1044
+ createUniqueIndex: () => Promise<void>;
1045
+ add: (value: TPromoCode) => Promise<mongodb.InsertOneResult<bson.Document>>;
1046
+ getByCode: (code: string, type?: string, assigned?: boolean | null) => Promise<TPromoCode>;
1047
+ getById: (_id: string | ObjectId) => Promise<TPromoCode>;
1048
+ getPromoCodes: ({ search, page, limit, sort, type, status, }: {
1049
+ search?: string | undefined;
1050
+ page?: number | undefined;
1051
+ limit?: number | undefined;
1052
+ sort?: Record<string, any> | undefined;
1053
+ type?: string | undefined;
1054
+ status: string;
1055
+ }) => Promise<{}>;
1056
+ assignByUserId: ({ user, code }: {
1057
+ user: string | ObjectId;
1058
+ code: string;
1059
+ }, session?: ClientSession) => Promise<void>;
1060
+ };
1061
+
1062
+ declare function usePromoCodeController(): {
1063
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1064
+ getByCode: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1065
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1066
+ getPromoCodes: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1067
+ };
1068
+
1069
+ type TFeedbackMetadata = {
1070
+ serviceProvider?: string | ObjectId;
1071
+ assignee?: string | ObjectId;
1072
+ organization?: string | ObjectId;
1073
+ site?: string | ObjectId;
1074
+ name?: string;
1075
+ signature?: string;
1076
+ attachments?: Array<string>;
1077
+ completedAt?: string | Date;
1078
+ };
1079
+ type TFeedback = {
1080
+ _id?: ObjectId;
1081
+ attachments?: Array<string>;
1082
+ subject: string;
1083
+ category: string;
1084
+ highPriority?: boolean;
1085
+ location: string;
1086
+ description: string;
1087
+ createdBy: string | ObjectId;
1088
+ createdByName?: string;
1089
+ metadata?: TFeedbackMetadata;
1090
+ serviceProvider?: TFeedbackMetadata["serviceProvider"];
1091
+ assignee?: TFeedbackMetadata["assignee"];
1092
+ organization?: TFeedbackMetadata["organization"];
1093
+ site?: TFeedbackMetadata["site"];
1094
+ status?: string;
1095
+ createdAt?: Date;
1096
+ updatedAt?: string | Date;
1097
+ acceptedAt?: string | Date;
1098
+ deletedAt?: string | Date;
1099
+ workOrderId?: string | ObjectId;
1100
+ };
1101
+ type TFeedbackUpdate = Partial<Pick<TFeedback, "attachments" | "subject" | "description" | "category" | "location" | "workOrderId">>;
1102
+ type TFeedbackUpdateStatus = {
1103
+ status: NonNullable<TFeedback["status"]>;
1104
+ };
1105
+ type TFeedbackUpdateCategory = Pick<TFeedback, "category">;
1106
+ type TFeedbackUpdateServiceProvider = {
1107
+ serviceProvider: NonNullable<TFeedback["serviceProvider"]>;
1108
+ };
1109
+ type TFeedbackUpdateToCompleted = {
1110
+ attachments: NonNullable<TFeedbackMetadata["attachments"]>;
1111
+ name: NonNullable<TFeedbackMetadata["name"]>;
1112
+ signature: NonNullable<TFeedbackMetadata["signature"]>;
1113
+ };
1114
+ declare const feedbackSchema: Joi.ObjectSchema<any>;
1115
+ declare function MFeedback(value: TFeedback): {
1116
+ attachments: string[];
1117
+ subject: string;
1118
+ category: string;
1119
+ highPriority: boolean;
1120
+ location: string;
1121
+ description: string;
1122
+ createdBy: string | ObjectId;
1123
+ createdByName: string;
1124
+ metadata: {
1125
+ serviceProvider: string | ObjectId;
1126
+ assignee: string | ObjectId;
1127
+ organization: string | ObjectId;
1128
+ site: string | ObjectId;
1129
+ name: string;
1130
+ signature: string;
1131
+ attachments: string[];
1132
+ completedAt: string | Date;
1133
+ };
1134
+ status: string;
1135
+ createdAt: Date;
1136
+ updatedAt: string | Date;
1137
+ acceptedAt: string | Date;
1138
+ deletedAt: string | Date;
1139
+ workOrderId: string | ObjectId;
1140
+ };
1141
+
1142
+ declare function useFeedbackRepo(): {
1143
+ createIndex: () => Promise<void>;
1144
+ createTextIndex: () => Promise<void>;
1145
+ createFeedback: (value: TFeedback, session?: ClientSession) => Promise<ObjectId>;
1146
+ getFeedbacks: ({ search, page, limit, sort, site, status, serviceProvider, from, to, category, }: {
1147
+ search?: string | undefined;
1148
+ page?: number | undefined;
1149
+ limit?: number | undefined;
1150
+ sort?: Record<string, any> | undefined;
1151
+ site: string | ObjectId;
1152
+ status: string;
1153
+ serviceProvider?: string | ObjectId | undefined;
1154
+ from?: string | undefined;
1155
+ to?: string | undefined;
1156
+ category?: string | undefined;
1157
+ }) => Promise<TFeedback | {
1158
+ items: any[];
1159
+ pages: number;
1160
+ pageRange: string;
1161
+ }>;
1162
+ getFeedbackById: (_id: string | ObjectId) => Promise<bson.Document>;
1163
+ updateFeedback: (_id: string | ObjectId, value: TFeedbackUpdate) => Promise<number>;
1164
+ updateFeedbackStatus: (_id: string | ObjectId, value: TFeedbackUpdateStatus) => Promise<number>;
1165
+ updateFeedbackCreatedByName: (_id: string | ObjectId, value: string | ObjectId, session?: ClientSession) => Promise<number>;
1166
+ updateFeedbackCategory: (_id: string | ObjectId, value: TFeedbackUpdateCategory) => Promise<number>;
1167
+ updateFeedbackToCompleted: (_id: string | ObjectId, value: TFeedbackUpdateToCompleted) => Promise<number>;
1168
+ deleteFeedback: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
1169
+ };
1170
+
1171
+ declare function useFeedbackService(): {
1172
+ createFeedback: (value: TFeedback) => Promise<ObjectId>;
1173
+ getFeedbacks: ({ search, page, limit, sort, site, status, serviceProvider, from, to, category, }: {
1174
+ search?: string | undefined;
1175
+ page?: number | undefined;
1176
+ limit?: number | undefined;
1177
+ sort?: Record<string, any> | undefined;
1178
+ site: string;
1179
+ status: string;
1180
+ serviceProvider?: string | undefined;
1181
+ from?: string | undefined;
1182
+ to?: string | undefined;
1183
+ category?: string | undefined;
1184
+ }) => Promise<TFeedback | {
1185
+ items: any[];
1186
+ pages: number;
1187
+ pageRange: string;
1188
+ }>;
1189
+ };
1190
+
1191
+ declare function useFeedbackController(): {
1192
+ createFeedback: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1193
+ getFeedbacks: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1194
+ getFeedbackById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1195
+ updateFeedback: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1196
+ updateFeedbackStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1197
+ updateFeedbackCategory: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1198
+ updateFeedbackToCompleted: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1199
+ deleteFeedback: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1200
+ };
1201
+
1202
+ type TWorkOrderMetadata = {
1203
+ feedback?: string | ObjectId;
1204
+ serviceProvider?: string | ObjectId;
1205
+ assignee?: string | ObjectId;
1206
+ organization?: string | ObjectId;
1207
+ site?: string | ObjectId;
1208
+ name?: string;
1209
+ signature?: string;
1210
+ attachments?: Array<string>;
1211
+ completedAt?: string | Date;
1212
+ };
1213
+ type TWorkOrder = {
1214
+ _id?: ObjectId;
1215
+ workOrderNo?: string;
1216
+ attachments?: Array<string>;
1217
+ subject: string;
1218
+ category: string;
1219
+ highPriority?: boolean;
1220
+ block?: string;
1221
+ level?: string;
1222
+ unit?: string;
1223
+ location?: string;
1224
+ description: string;
1225
+ createdBy: string | ObjectId;
1226
+ createdByName?: string;
1227
+ metadata?: TWorkOrderMetadata;
1228
+ feedback?: TWorkOrderMetadata["feedback"];
1229
+ serviceProvider?: TWorkOrderMetadata["serviceProvider"];
1230
+ assignee?: TWorkOrderMetadata["assignee"];
1231
+ organization?: TWorkOrderMetadata["organization"];
1232
+ site?: TWorkOrderMetadata["site"];
1233
+ status?: string;
1234
+ createdAt?: Date;
1235
+ updatedAt?: string | Date;
1236
+ acceptedAt?: string | Date;
1237
+ deletedAt?: string | Date;
1238
+ };
1239
+ type TWorkOrderUpdate = Partial<Pick<TWorkOrder, "attachments">>;
1240
+ type TWorkOrderUpdateStatus = {
1241
+ status: NonNullable<TWorkOrder["status"]>;
1242
+ };
1243
+ type TWorkOrderUpdateToCompleted = {
1244
+ attachments: NonNullable<TWorkOrderMetadata["attachments"]>;
1245
+ name: NonNullable<TWorkOrderMetadata["name"]>;
1246
+ signature: NonNullable<TWorkOrderMetadata["signature"]>;
1247
+ };
1248
+ declare const workOrderSchema: Joi.ObjectSchema<any>;
1249
+ declare function MWorkOrder(value: TWorkOrder): {
1250
+ workOrderNo: string;
1251
+ attachments: string[];
1252
+ subject: string;
1253
+ category: string;
1254
+ highPriority: boolean;
1255
+ block: string;
1256
+ level: string;
1257
+ unit: string;
1258
+ location: string;
1259
+ description: string;
1260
+ createdBy: string | ObjectId;
1261
+ createdByName: string;
1262
+ metadata: {
1263
+ feedback: string | ObjectId;
1264
+ serviceProvider: string | ObjectId;
1265
+ assignee: string | ObjectId;
1266
+ organization: string | ObjectId;
1267
+ site: string | ObjectId;
1268
+ name: string;
1269
+ signature: string;
1270
+ attachments: string[];
1271
+ completedAt: string | Date;
1272
+ };
1273
+ status: string;
1274
+ createdAt: Date;
1275
+ updatedAt: string | Date;
1276
+ acceptedAt: string | Date;
1277
+ deletedAt: string | Date;
1278
+ };
1279
+
1280
+ declare function useWorkOrderRepo(): {
1281
+ createIndex: () => Promise<void>;
1282
+ createTextIndex: () => Promise<void>;
1283
+ createWorkOrder: (value: TWorkOrder, session?: ClientSession) => Promise<ObjectId>;
1284
+ getWorkOrders: ({ search, page, limit, sort, site, status, serviceProvider, category, }: {
1285
+ search?: string | undefined;
1286
+ page?: number | undefined;
1287
+ limit?: number | undefined;
1288
+ sort?: Record<string, any> | undefined;
1289
+ site: string | ObjectId;
1290
+ status: string;
1291
+ serviceProvider?: string | ObjectId | undefined;
1292
+ category?: string | undefined;
1293
+ }) => Promise<{}>;
1294
+ getWorkOrderById: (_id: string | ObjectId) => Promise<{}>;
1295
+ updateWorkOrder: (_id: string | ObjectId, value: TWorkOrderUpdate) => Promise<number>;
1296
+ updateWorkOrderStatus: (_id: string | ObjectId, value: TWorkOrderUpdateStatus) => Promise<number>;
1297
+ updateWorkOrderCreatedByName: (_id: string | ObjectId, value: string | ObjectId, session?: ClientSession) => Promise<number>;
1298
+ updateWorkOrderToCompleted: (_id: string | ObjectId, value: TWorkOrderUpdateToCompleted) => Promise<number>;
1299
+ deleteWorkOrder: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
1300
+ };
1301
+
1302
+ declare function useWorkOrderService(): {
1303
+ createWorkOrder: (value: TWorkOrder, fullHost?: string) => Promise<bson.ObjectId>;
1304
+ getWorkOrders: ({ search, page, limit, sort, site, status, serviceProvider, category, }: {
1305
+ search?: string | undefined;
1306
+ page?: number | undefined;
1307
+ limit?: number | undefined;
1308
+ sort?: Record<string, any> | undefined;
1309
+ site: string;
1310
+ status: string;
1311
+ serviceProvider?: string | undefined;
1312
+ category?: string | undefined;
1313
+ }) => Promise<{}>;
1314
+ };
1315
+
1316
+ declare function useWorkOrderController(): {
1317
+ createWorkOrder: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1318
+ getWorkOrders: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1319
+ getWorkOrderById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1320
+ updateWorkOrder: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1321
+ updateWorkOrderStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1322
+ updateWorkOrderToCompleted: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1323
+ deleteWorkOrder: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1324
+ };
1325
+
1326
+ type TServiceProvider = {
1327
+ _id?: ObjectId;
1328
+ name?: string;
1329
+ orgId: string | ObjectId;
1330
+ siteId: string | ObjectId;
1331
+ orgName?: string;
1332
+ category?: string;
1333
+ type: string;
1334
+ status?: string;
1335
+ email?: string;
1336
+ description?: string;
1337
+ siteName?: string;
1338
+ createdAt?: string | Date;
1339
+ updatedAt?: string | Date;
1340
+ deletedAt?: string | Date;
1341
+ };
1342
+ declare const schemaServiceProvider: Joi.ObjectSchema<any>;
1343
+ declare function MServiceProvider(value: TServiceProvider): {
1344
+ name: string;
1345
+ orgId: string | ObjectId;
1346
+ siteId: string | ObjectId;
1347
+ orgName: string;
1348
+ category: string;
1349
+ type: string;
1350
+ status: string;
1351
+ email: string;
1352
+ description: string;
1353
+ siteName: string;
1354
+ createdAt: string | Date;
1355
+ updatedAt: string | Date | undefined;
1356
+ deletedAt: string | Date | undefined;
1357
+ };
1358
+
1359
+ declare function useServiceProviderRepo(): {
1360
+ createTextIndex: () => Promise<void>;
1361
+ createUniqueIndex: () => Promise<void>;
1362
+ createServiceProvider: (value: TServiceProvider, session?: ClientSession) => Promise<ObjectId>;
1363
+ getServiceProviders: ({ search, page, limit, sort, orgId, siteId, serviceProviderOrgId, status, }: {
1364
+ search?: string | undefined;
1365
+ page?: number | undefined;
1366
+ limit?: number | undefined;
1367
+ sort?: Record<string, any> | undefined;
1368
+ orgId?: string | ObjectId | undefined;
1369
+ siteId?: string | ObjectId | undefined;
1370
+ serviceProviderOrgId?: string | ObjectId | undefined;
1371
+ status?: string | undefined;
1372
+ }) => Promise<{}>;
1373
+ getServiceProviderNames: ({ page, limit, search, sort, }: {
1374
+ page?: number | undefined;
1375
+ limit?: number | undefined;
1376
+ search?: string | undefined;
1377
+ sort?: Record<string, any> | undefined;
1378
+ }) => Promise<{}>;
1379
+ getServiceProviderTypes: ({ search, page, limit, sort, }: {
1380
+ search?: string | undefined;
1381
+ page?: number | undefined;
1382
+ limit?: number | undefined;
1383
+ sort?: Record<string, any> | undefined;
1384
+ }) => Promise<{}>;
1385
+ getServiceProviderById: (_id: string | ObjectId, session?: ClientSession) => Promise<{}>;
1386
+ getByServiceProviderOrgIdType: (serviceProviderOrgId: string | ObjectId, type: string) => Promise<{}>;
1387
+ getByEmail: ({ email, siteId, orgId, serviceProviderOrgId }?: {
1388
+ email: string;
1389
+ siteId?: string | ObjectId | undefined;
1390
+ orgId?: string | ObjectId | undefined;
1391
+ serviceProviderOrgId?: string | ObjectId | undefined;
1392
+ }) => Promise<{} | null>;
1393
+ };
1394
+
1395
+ declare function useServiceProviderController(): {
1396
+ createServiceProvider: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1397
+ getServiceProviders: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1398
+ getByProviderOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1399
+ getServiceProviderNames: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1400
+ getServiceProviderTypes: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1401
+ getServiceProviderById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1402
+ getByServiceProviderOrgIdType: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1403
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1404
+ };
1405
+
1406
+ type TCustomer = {
1407
+ _id?: ObjectId;
1408
+ name: string;
1409
+ orgId: string | ObjectId;
1410
+ customerOrgId?: string | ObjectId;
1411
+ sites?: number;
1412
+ customerSites?: Array<Record<string, any>>;
1413
+ customerSiteId?: string;
1414
+ status?: string;
1415
+ createdAt?: Date;
1416
+ updatedAt?: string | Date;
1417
+ deletedAt?: string | Date;
1418
+ };
1419
+ declare const customerSchema: Joi.ObjectSchema<any>;
1420
+ declare function MCustomer(value: TCustomer): {
1421
+ name: string;
1422
+ orgId: string | ObjectId;
1423
+ customerOrgId: string | ObjectId;
1424
+ sites: number;
1425
+ status: string;
1426
+ createdAt: Date;
1427
+ updatedAt: string | Date;
1428
+ deletedAt: string | Date;
1429
+ };
1430
+
1431
+ declare function useCustomerRepo(): {
1432
+ createIndex: () => Promise<void>;
1433
+ createTextIndex: () => Promise<void>;
1434
+ createUniqueIndex: () => Promise<void>;
1435
+ createCustomer: (value: TCustomer, session?: ClientSession) => Promise<ObjectId>;
1436
+ getAll: ({ search, page, limit, sort, org, status, }: {
1437
+ search?: string | undefined;
1438
+ page?: number | undefined;
1439
+ limit?: number | undefined;
1440
+ sort?: Record<string, any> | undefined;
1441
+ org: string | ObjectId;
1442
+ status: string;
1443
+ }, session?: ClientSession) => Promise<{
1444
+ items: any[];
1445
+ pages: number;
1446
+ pageRange: string;
1447
+ } | {
1448
+ createdAt: Date;
1449
+ type: string;
1450
+ count: number;
1451
+ _id?: ObjectId | undefined;
1452
+ updatedAt?: Date | undefined;
1453
+ deletedAt?: Date | undefined;
1454
+ }>;
1455
+ getCustomerById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | {
1456
+ createdAt: Date;
1457
+ type: string;
1458
+ count: number;
1459
+ _id?: ObjectId | undefined;
1460
+ updatedAt?: Date | undefined;
1461
+ deletedAt?: Date | undefined;
1462
+ }>;
1463
+ updateSiteCounterById: (_id: string | ObjectId, mode: string, session?: ClientSession) => Promise<string>;
1464
+ deleteCustomer: (_id: string | ObjectId) => Promise<number>;
1465
+ };
1466
+
1467
+ declare function useCustomerController(): {
1468
+ createCustomer: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1469
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1470
+ getCustomerById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1471
+ deleteCustomer: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1472
+ };
1473
+
1474
+ type TSiteMetadata = {
1475
+ block?: number;
1476
+ guardPosts?: number;
1477
+ gracePeriod?: number;
1478
+ incidentCounter?: number;
1479
+ };
1480
+ type TSite = {
1481
+ _id?: ObjectId;
1482
+ name: string;
1483
+ description?: string;
1484
+ orgId: string | ObjectId;
1485
+ metadata?: TSiteMetadata;
1486
+ status?: string;
1487
+ createdAt?: Date;
1488
+ updatedAt?: string | Date;
1489
+ deletedAt?: string | Date;
1490
+ };
1491
+ type TSiteUpdateBlock = NonNullable<TSiteMetadata["block"]>;
1492
+ declare const allowedFieldsSite: string[];
1493
+ declare const siteSchema: Joi.ObjectSchema<any>;
1494
+ declare function MSite(value: TSite): {
1495
+ name: string;
1496
+ description: string;
1497
+ orgId: string | ObjectId;
1498
+ metadata: TSiteMetadata;
1499
+ status: string;
1500
+ createdAt: Date;
1501
+ updatedAt: string | Date;
1502
+ deletedAt: string | Date;
1503
+ };
1504
+
1505
+ declare function useSiteRepo(): {
1506
+ createIndexes: () => Promise<void>;
1507
+ createSite: (value: TSite, session?: ClientSession) => Promise<ObjectId>;
1508
+ getSites: ({ page, limit, search, sort, org, }: {
1509
+ page?: number | undefined;
1510
+ limit?: number | undefined;
1511
+ search?: string | undefined;
1512
+ sort?: Record<string, any> | undefined;
1513
+ org: string | ObjectId;
1514
+ }) => Promise<{}>;
1515
+ getAllSites: ({ page, limit, }: {
1516
+ page: number;
1517
+ limit: number;
1518
+ }) => Promise<{
1519
+ items: {
1520
+ _id: ObjectId;
1521
+ name: string;
1522
+ }[];
1523
+ pages: number;
1524
+ pageRange: string;
1525
+ }>;
1526
+ getSiteById: (_id: string | ObjectId) => Promise<TSite>;
1527
+ updateSiteBlock: (_id: string | ObjectId, block: TSiteUpdateBlock) => Promise<number>;
1528
+ deleteSite: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
1529
+ updateById: ({ _id, field, value, type }?: {
1530
+ _id: string | ObjectId;
1531
+ field: string;
1532
+ value: string | number | ObjectId;
1533
+ type?: string | undefined;
1534
+ }, session?: ClientSession) => Promise<string>;
1535
+ getByName: (name?: string) => Promise<TSite[]>;
1536
+ getByExactName: (name: string, orgId: string | ObjectId) => Promise<TSite[]>;
1537
+ updateSiteIncidentCounter: (_id: string | ObjectId, incidentCounter: number, session?: ClientSession) => Promise<number>;
1538
+ };
1539
+
1540
+ declare function useSiteService(): {
1541
+ createSite: (value: {
1542
+ orgId: string;
1543
+ name: string;
1544
+ description?: string | undefined;
1545
+ customerId: string;
1546
+ }) => Promise<{
1547
+ site: bson.ObjectId;
1548
+ }>;
1549
+ updateGuardPostById: (site: string, guardPost: number) => Promise<void>;
1550
+ };
1551
+
1552
+ declare function useSiteController(): {
1553
+ createSite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1554
+ getSites: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1555
+ getSiteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1556
+ updateSiteBlock: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1557
+ deleteSite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1558
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1559
+ updateGuardPostsById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1560
+ };
1561
+
1562
+ type TChat = {
1563
+ _id?: ObjectId;
1564
+ attachments?: Array<string>;
1565
+ type: string;
1566
+ comment: string;
1567
+ feedbackId: string | ObjectId;
1568
+ workOrderId: string | ObjectId;
1569
+ createdBy: string | ObjectId;
1570
+ createdAt?: string;
1571
+ updatedAt?: string;
1572
+ };
1573
+ declare const chatSchema: Joi.ObjectSchema<any>;
1574
+ declare function MChat(value: TChat): {
1575
+ attachments: string[];
1576
+ type: string;
1577
+ comment: string;
1578
+ feedbackId: string | ObjectId;
1579
+ workOrderId: string | ObjectId;
1580
+ createdBy: string | ObjectId;
1581
+ createdAt: string;
1582
+ updatedAt: string;
1583
+ };
1584
+
1585
+ declare function useChatRepo(): {
1586
+ createChat: (value: TChat, session?: ClientSession) => Promise<bson.ObjectId>;
1587
+ };
1588
+
1589
+ declare function useChatController(): {
1590
+ createChat: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1591
+ };
1592
+
1593
+ type TBuilding = {
1594
+ _id?: ObjectId;
1595
+ site: ObjectId;
1596
+ name?: string;
1597
+ block: number;
1598
+ levels: string[];
1599
+ createdAt?: Date | string;
1600
+ updatedAt?: Date | string;
1601
+ deletedAt?: Date | string;
1602
+ status?: string;
1603
+ buildingFloorPlan?: string[];
1604
+ };
1605
+ declare const schemaBuilding: Joi.ObjectSchema<any>;
1606
+ declare const schemaBuildingUpdateOptions: Joi.ObjectSchema<any>;
1607
+ type TBilling = {
1608
+ _id?: ObjectId | string;
1609
+ name?: string;
1610
+ };
1611
+ type TBuildingUnit = {
1612
+ _id?: ObjectId;
1613
+ site: ObjectId | string;
1614
+ name?: string;
1615
+ building: ObjectId | string;
1616
+ buildingName?: string;
1617
+ block: number;
1618
+ level: string;
1619
+ category: string;
1620
+ status: string;
1621
+ owner?: ObjectId | string;
1622
+ ownerName?: string;
1623
+ billing?: Array<TBilling>;
1624
+ createdAt?: Date | string;
1625
+ updatedAt?: Date | string;
1626
+ deletedAt?: Date | string;
1627
+ buildingUnitFiles?: string[];
1628
+ companyName?: string;
1629
+ companyRegistrationNumber?: number | string;
1630
+ leaseStart?: Date | string;
1631
+ leaseEnd?: Date | string;
1632
+ };
1633
+ declare const schemaBilling: Joi.ObjectSchema<any>;
1634
+ declare const schemaBuildingUnit: Joi.ObjectSchema<any>;
1635
+ declare const schemaUpdateOptions: Joi.ObjectSchema<any>;
1636
+ declare function MBuilding(value: TBuilding): {
1637
+ _id: ObjectId | undefined;
1638
+ site: ObjectId;
1639
+ name: string;
1640
+ block: number;
1641
+ levels: string[];
1642
+ status: string;
1643
+ buildingFloorPlan: string[];
1644
+ createdAt: string | Date;
1645
+ updatedAt: string | Date;
1646
+ deletedAt: string | Date;
1647
+ };
1648
+ declare function MBuildingUnit(value: TBuildingUnit): {
1649
+ _id: ObjectId | undefined;
1650
+ site: ObjectId;
1651
+ name: string;
1652
+ building: ObjectId;
1653
+ buildingName: string;
1654
+ block: number;
1655
+ level: string;
1656
+ category: string;
1657
+ status: string;
1658
+ buildingUnitFiles: string[];
1659
+ owner: string | ObjectId;
1660
+ ownerName: string;
1661
+ createdAt: string | Date;
1662
+ updatedAt: string | Date;
1663
+ deletedAt: string | Date;
1664
+ companyName: string;
1665
+ companyRegistrationNumber: string | number;
1666
+ leaseStart: string | Date;
1667
+ leaseEnd: string | Date;
1668
+ billing: TBilling[];
1669
+ };
1670
+
1671
+ declare function useBuildingRepo(): {
1672
+ createIndexes: () => Promise<void>;
1673
+ add: (value: TBuilding, session?: ClientSession) => Promise<ObjectId>;
1674
+ getAll: ({ search, page, limit, sort, site, status, }?: {
1675
+ search?: string | undefined;
1676
+ page?: number | undefined;
1677
+ limit?: number | undefined;
1678
+ sort?: {} | undefined;
1679
+ site?: string | undefined;
1680
+ status?: string | undefined;
1681
+ }) => Promise<Record<string, any>>;
1682
+ getById: (_id: string | ObjectId) => Promise<TBuilding | null>;
1683
+ updateById: (_id: ObjectId | string, value: Pick<TBuilding, "name" | "block" | "levels" | "buildingFloorPlan">, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
1684
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
1685
+ getBuildingLevel: (site: string | ObjectId, block: number) => Promise<mongodb.WithId<bson.Document> | TBuilding | null>;
1686
+ };
1687
+
1688
+ declare function useBuildingService(): {
1689
+ add: (value: TBuilding) => Promise<bson.ObjectId>;
1690
+ updateById: (id: string, data: Pick<TBuilding, "name" | "block" | "levels" | "buildingFloorPlan">) => Promise<mongodb.UpdateResult<bson.Document>>;
1691
+ deleteById: (id: string) => Promise<string>;
1692
+ };
1693
+
1694
+ declare function useBuildingController(): {
1695
+ createBuilding: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1696
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1697
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1698
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1699
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1700
+ getBuildingLevel: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1701
+ };
1702
+
1703
+ declare function useBuildingUnitRepo(): {
1704
+ createIndexes: () => Promise<void>;
1705
+ add: (value: TBuildingUnit, session?: ClientSession) => Promise<ObjectId>;
1706
+ getAll: ({ search, page, limit, sort, site, building, status, }?: {
1707
+ search?: string | undefined;
1708
+ page?: number | undefined;
1709
+ limit?: number | undefined;
1710
+ sort?: {} | undefined;
1711
+ site?: string | undefined;
1712
+ building?: string | undefined;
1713
+ status?: string | undefined;
1714
+ }) => Promise<Record<string, any>>;
1715
+ getById: (_id: string | ObjectId, session?: ClientSession) => Promise<TBuildingUnit>;
1716
+ getByBuildingLevel: (building: string | ObjectId, level: string) => Promise<TBuildingUnit | null>;
1717
+ updateById: (_id: string | ObjectId, value: Partial<Pick<TBuildingUnit, "name" | "level" | "category" | "buildingName" | "block" | "buildingUnitFiles" | "ownerName" | "billing">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
1718
+ getByBuilding: (building: string | ObjectId) => Promise<TBuildingUnit | null>;
1719
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
1720
+ updateLevelByBuildingLevel: (building: string | ObjectId, level: string, newLevel: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
1721
+ updateByBuildingId: (building: string | ObjectId, value: Partial<Pick<TBuildingUnit, "buildingName" | "block">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
1722
+ getBuildingUnits: (site: string | ObjectId, block: number, level: string) => Promise<{}>;
1723
+ getBuildingUnitsWithOwner: (site: string | ObjectId, unitIds?: ObjectId[]) => Promise<{}>;
1724
+ };
1725
+
1726
+ declare function useBuildingUnitService(): {
1727
+ add: (value: {
1728
+ labels: string[];
1729
+ unit: TBuildingUnit;
1730
+ qty: number;
1731
+ }) => Promise<string>;
1732
+ updateById: (id: string, value: Pick<TBuildingUnit, "name" | "category" | "level" | "buildingUnitFiles">) => Promise<string>;
1733
+ };
1734
+
1735
+ declare function useBuildingUnitController(): {
1736
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1737
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1738
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1739
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1740
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1741
+ getBuildingUnits: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1742
+ getBuildingUnitsWithOwner: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1743
+ };
1744
+
1745
+ declare function useDahuaService(): {
1746
+ getSnapshot: () => Promise<string>;
1747
+ getTrafficJunction: (host?: string, username?: string, password?: string, site?: string, gate?: string, designation?: string) => Promise<void>;
1748
+ addPlateNumber: (value: {
1749
+ host: string;
1750
+ username: string;
1751
+ password: string;
1752
+ plateNumber: string;
1753
+ mode: string;
1754
+ start?: string;
1755
+ end?: string;
1756
+ owner?: string;
1757
+ }) => Promise<urllib.HttpClientResponse<any>>;
1758
+ removePlateNumber: (value: {
1759
+ host: string;
1760
+ username: string;
1761
+ password: string;
1762
+ mode: string;
1763
+ recno: string;
1764
+ }) => Promise<urllib.HttpClientResponse<any> | undefined>;
1765
+ };
1766
+
1767
+ type TVehicle = {
1768
+ _id?: ObjectId;
1769
+ plateNumber: string;
1770
+ type: string;
1771
+ category: string;
1772
+ name: string;
1773
+ phoneNumber?: string;
1774
+ recNo?: string;
1775
+ org: string | ObjectId;
1776
+ site: string | ObjectId;
1777
+ block?: number;
1778
+ level?: string;
1779
+ unit?: string | ObjectId;
1780
+ nric?: string;
1781
+ remarks?: string;
1782
+ seasonPassType?: string;
1783
+ start?: Date | string;
1784
+ end?: Date | string;
1785
+ status?: string;
1786
+ unitName?: string;
1787
+ createdAt?: Date | string;
1788
+ updatedAt?: Date | string;
1789
+ deletedAt?: Date | string;
1790
+ };
1791
+ type TVehicleUpdate = Partial<Pick<TVehicle, "name" | "phoneNumber" | "block" | "level" | "unit" | "plateNumber">>;
1792
+ declare const allowedTypes: string[];
1793
+ declare const allowedCategories: string[];
1794
+ declare const vehicleSchema: Joi.ObjectSchema<any>;
1795
+ declare function MVehicle(value: TVehicle): {
1796
+ plateNumber: string;
1797
+ type: string;
1798
+ category: string;
1799
+ name: string;
1800
+ phoneNumber: string;
1801
+ recNo: string;
1802
+ org: string | ObjectId;
1803
+ site: string | ObjectId;
1804
+ block: number;
1805
+ level: string;
1806
+ unit: string | ObjectId;
1807
+ nric: string;
1808
+ remarks: string;
1809
+ seasonPassType: string;
1810
+ start: string | Date;
1811
+ end: string | Date;
1812
+ status: string;
1813
+ unitName: string;
1814
+ createdAt: string | Date;
1815
+ updatedAt: string | Date;
1816
+ deletedAt: string | Date;
1817
+ };
1818
+ type TVehicleTransaction = {
1819
+ _id?: ObjectId;
1820
+ site: string | ObjectId;
1821
+ plateNumber: string;
1822
+ owner?: string;
1823
+ in?: Date | string;
1824
+ inSnapshot?: string;
1825
+ out?: Date | string;
1826
+ outSnapshot?: string;
1827
+ type: string;
1828
+ category?: string;
1829
+ };
1830
+ declare const schemaVehicleTransaction: Joi.ObjectSchema<any>;
1831
+ declare function MVehicleTransaction(value: TVehicleTransaction): {
1832
+ _id: ObjectId | undefined;
1833
+ site: ObjectId;
1834
+ plateNumber: string;
1835
+ owner: string;
1836
+ in: string | Date;
1837
+ inSnapshot: string;
1838
+ out: string | Date;
1839
+ outSnapshot: string;
1840
+ type: string;
1841
+ category: string;
1842
+ };
1843
+
1844
+ declare function useVehicleRepo(): {
1845
+ createIndex: () => Promise<void>;
1846
+ add: (value: TVehicle, session?: ClientSession) => Promise<ObjectId>;
1847
+ getVehicles: ({ page, limit, search, sort, type, category, }: {
1848
+ page?: number | undefined;
1849
+ limit?: number | undefined;
1850
+ search?: string | undefined;
1851
+ sort?: Record<string, any> | undefined;
1852
+ type?: string | undefined;
1853
+ category?: string | undefined;
1854
+ }) => Promise<{}>;
1855
+ getSeasonPassTypes: (site: string | ObjectId) => Promise<{}>;
1856
+ getVehicleById: (_id: string | ObjectId) => Promise<{}>;
1857
+ updateVehicle: (_id: string | ObjectId, value: TVehicleUpdate) => Promise<number>;
1858
+ deleteVehicle: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
1859
+ getByPlaceNumber: (value: string) => Promise<{}>;
1860
+ getVehicleByPlateNumber: (plateNumber: string) => Promise<TVehicle | null>;
1861
+ };
1862
+
1863
+ declare function useVehicleService(): {
1864
+ add: (value: TVehicle) => Promise<string>;
1865
+ deleteVehicle: (_id: string, recno: string, site: string, bypass?: boolean) => Promise<string>;
1866
+ };
1867
+
1868
+ declare function useVehicleController(): {
1869
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1870
+ getVehicles: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1871
+ getSeasonPassTypes: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1872
+ getVehicleById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1873
+ updateVehicle: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1874
+ deleteVehicle: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1875
+ };
1876
+
1877
+ type TCamera = {
1878
+ host: string;
1879
+ username: string;
1880
+ password: string;
1881
+ type: string;
1882
+ };
1883
+ type TSiteCamera = {
1884
+ _id?: ObjectId;
1885
+ site: string | ObjectId;
1886
+ host: string;
1887
+ username: string;
1888
+ password: string;
1889
+ type: string;
1890
+ category: string;
1891
+ guardPost?: number;
1892
+ status?: string;
1893
+ direction?: string;
1894
+ createdAt?: Date | string;
1895
+ updatedAt?: Date | string;
1896
+ deletedAt?: Date | string;
1897
+ };
1898
+ declare const schemaUpdateSiteCamera: Joi.ObjectSchema<any>;
1899
+ declare const schemaSiteCamera: Joi.ObjectSchema<any>;
1900
+ declare function MSiteCamera(value: TSiteCamera): {
1901
+ _id: ObjectId;
1902
+ site: ObjectId;
1903
+ host: string;
1904
+ username: string;
1905
+ password: string;
1906
+ type: string;
1907
+ category: string;
1908
+ guardPost: number;
1909
+ status: string;
1910
+ direction: string;
1911
+ createdAt: string | Date;
1912
+ updatedAt: string | Date;
1913
+ deletedAt: string | Date;
1914
+ };
1915
+
1916
+ declare function useSiteCameraRepo(): {
1917
+ createIndexes: () => Promise<string | undefined>;
1918
+ add: (value: TSiteCamera, session?: ClientSession) => Promise<ObjectId>;
1919
+ getAll: (value: {
1920
+ type: string;
1921
+ site?: string | ObjectId;
1922
+ direction?: string | string[];
1923
+ page?: number;
1924
+ limit?: number;
1925
+ }) => Promise<{
1926
+ pageRange: string;
1927
+ pages: number;
1928
+ items: Array<TSiteCamera>;
1929
+ }>;
1930
+ findSiteCameras: ({ site, type }: {
1931
+ site?: string | undefined;
1932
+ type?: string | undefined;
1933
+ }) => Promise<bson.Document[]>;
1934
+ getBySite: (site: string | ObjectId, options?: {
1935
+ type?: string;
1936
+ category?: string;
1937
+ guardPost?: number;
1938
+ }) => Promise<{} | null>;
1939
+ getBySites: (site: string | ObjectId, options?: {
1940
+ type?: string;
1941
+ category?: string;
1942
+ direction?: string;
1943
+ }) => Promise<{}>;
1944
+ delCachedData: () => void;
1945
+ getBySiteGuardPost: (site: string | ObjectId, guardPost: number) => Promise<{} | null>;
1946
+ updateById: (_id: string | ObjectId, value: Partial<Pick<TSiteCamera, "host" | "username" | "password" | "category" | "guardPost">>, session?: ClientSession) => Promise<string>;
1947
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
1948
+ getAllCameraWithPassword: (value: {
1949
+ type: string;
1950
+ site?: string | ObjectId;
1951
+ direction?: string | string[];
1952
+ page?: number;
1953
+ limit?: number;
1954
+ }) => Promise<{
1955
+ pageRange: string;
1956
+ pages: number;
1957
+ items: Array<TSiteCamera>;
1958
+ }>;
1959
+ };
1960
+
1961
+ declare function useSiteCameraService(): {
1962
+ add: (value: TSiteCamera) => Promise<string>;
1963
+ listenToCapturedPlateNumber: () => Promise<void>;
1964
+ };
1965
+
1966
+ declare function useSiteCameraController(): {
1967
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1968
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1969
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1970
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1971
+ };
1972
+
1973
+ type TCustomerSite = {
1974
+ _id?: ObjectId;
1975
+ name: string;
1976
+ site?: ObjectId | string;
1977
+ siteOrg: ObjectId | string;
1978
+ siteOrgName: string;
1979
+ org: ObjectId | string;
1980
+ status?: string;
1981
+ createdAt?: string | Date;
1982
+ updatedAt?: string | Date;
1983
+ deletedAt?: string | Date;
1984
+ };
1985
+ declare const schemaCustomerSite: Joi.ObjectSchema<any>;
1986
+ declare function MCustomerSite(value: TCustomerSite): {
1987
+ _id: ObjectId | undefined;
1988
+ name: string;
1989
+ site: string | ObjectId | undefined;
1990
+ siteOrg: string | ObjectId;
1991
+ siteOrgName: string;
1992
+ org: string | ObjectId;
1993
+ status: string;
1994
+ createdAt: string | Date;
1995
+ updatedAt: string | Date;
1996
+ deletedAt: string | Date;
1997
+ };
1998
+
1999
+ declare function useCustomerSiteRepo(): {
2000
+ createIndexes: () => Promise<void>;
2001
+ add: (value: TCustomerSite, session?: ClientSession) => Promise<ObjectId>;
2002
+ getAll: ({ search, page, limit, sort, org, status, }: {
2003
+ search?: string | undefined;
2004
+ page?: number | undefined;
2005
+ limit?: number | undefined;
2006
+ sort?: Record<string, any> | undefined;
2007
+ org: string | ObjectId;
2008
+ status: string;
2009
+ }, session?: ClientSession) => Promise<{}>;
2010
+ getByName: (value: {
2011
+ name: string;
2012
+ org: string | ObjectId;
2013
+ }) => Promise<TCustomerSite[]>;
2014
+ getBySiteAsServiceProvider: (site: string | ObjectId) => Promise<{} | undefined>;
2015
+ };
2016
+
2017
+ declare function useCustomerSiteService(): {
2018
+ add: (value: TCustomerSite) => Promise<string>;
2019
+ addViaInvite: (invite: string) => Promise<string>;
2020
+ };
2021
+
2022
+ declare function useCustomerSiteController(): {
2023
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2024
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2025
+ addViaInvite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2026
+ getBySiteAsServiceProvider: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2027
+ };
2028
+
2029
+ type TAttendance = {
2030
+ _id?: ObjectId;
2031
+ site: string | ObjectId;
2032
+ checkIn: TAttendanceCheckTime;
2033
+ checkOut?: TAttendanceCheckTime;
2034
+ user: string | ObjectId;
2035
+ status?: string;
2036
+ createdAt?: string | Date;
2037
+ updatedAt?: string | Date;
2038
+ };
2039
+ interface TAttendanceLocation {
2040
+ latitude: number | string;
2041
+ longitude: number | string;
2042
+ }
2043
+ interface TAttendanceCheckTime {
2044
+ timestamp: Date | string;
2045
+ location?: TAttendanceLocation;
2046
+ img?: string;
2047
+ }
2048
+ type TAttendanceCheckIn = Pick<TAttendance, "site" | "checkIn" | "user">;
2049
+ type TAttendanceCheckOut = Pick<TAttendance, "user"> & {
2050
+ checkOut: TAttendanceCheckTime;
2051
+ };
2052
+ type TGetAttendancesQuery = {
2053
+ page?: number;
2054
+ limit?: number;
2055
+ search?: string;
2056
+ site: ObjectId | string;
2057
+ };
2058
+ type TGetAttendancesByUserQuery = Pick<TGetAttendancesQuery, "page" | "limit" | "search" | "site"> & Pick<TAttendance, "user">;
2059
+ declare const attendanceSchema: Joi.ObjectSchema<any>;
2060
+ declare function MAttendance(value: TAttendance): {
2061
+ site: string | ObjectId;
2062
+ checkIn: TAttendanceCheckTime;
2063
+ checkOut: null;
2064
+ user: string | ObjectId;
2065
+ status: string;
2066
+ createdAt: string;
2067
+ updatedAt: string | Date;
2068
+ };
2069
+
2070
+ type TAttendanceSettings = {
2071
+ site: string | ObjectId;
2072
+ isLocationEnabled: boolean;
2073
+ location?: TAttendanceLocation;
2074
+ isGeofencingEnabled?: boolean;
2075
+ mile?: number;
2076
+ };
2077
+ type TAttendanceSettingsGetBySite = Pick<TAttendanceSettings, "isLocationEnabled" | "location" | "isGeofencingEnabled" | "mile">;
2078
+ declare const attendanceSettingsSchema: Joi.ObjectSchema<any>;
2079
+ declare function MAttendanceSettings(value: TAttendanceSettings): {
2080
+ site: string | ObjectId;
2081
+ isLocationEnabled: boolean;
2082
+ location: TAttendanceLocation | undefined;
2083
+ isGeofencingEnabled: boolean | undefined;
2084
+ mile: number | undefined;
2085
+ };
2086
+
2087
+ declare function useAttendanceSettingsRepository(): {
2088
+ createIndex: () => Promise<void>;
2089
+ createAttendanceSettings: (value: TAttendanceSettings, session?: ClientSession) => Promise<ObjectId>;
2090
+ updateAttendanceSettings: (site: string | ObjectId, value: TAttendanceSettings, session?: ClientSession) => Promise<number>;
2091
+ getAttendanceSettingsBySite: (site: string | ObjectId, session?: ClientSession) => Promise<TAttendanceSettingsGetBySite | null>;
2092
+ };
2093
+
2094
+ declare function useAttendanceSettingsService(): {
2095
+ getAttendanceSettingsBySite: (site: string | ObjectId) => Promise<TAttendanceSettingsGetBySite | null>;
2096
+ };
2097
+
2098
+ declare function useAttendanceSettingsController(): {
2099
+ getAttendanceSettingsBySite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2100
+ updateAttendanceSettings: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2101
+ };
2102
+
2103
+ declare function useAttendanceRepository(): {
2104
+ createIndex: () => Promise<void>;
2105
+ checkInAttendance: (value: TAttendanceCheckIn, session?: ClientSession) => Promise<ObjectId>;
2106
+ getAllAttendances: ({ page, limit, search, site, }: TGetAttendancesQuery) => Promise<{}>;
2107
+ getAttendanceByUser: ({ page, limit, search, site, user, }: TGetAttendancesByUserQuery) => Promise<{}>;
2108
+ getAttendanceById: (_id: string | ObjectId, session?: ClientSession) => Promise<{}>;
2109
+ getRawAttendanceById: (_id: string | ObjectId, session?: ClientSession) => Promise<TAttendance>;
2110
+ checkOutAttendance: (_id: string | ObjectId, value: TAttendanceCheckOut, session?: ClientSession) => Promise<number>;
2111
+ deleteAttendance: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
2112
+ };
2113
+
2114
+ declare function useAttendanceController(): {
2115
+ checkInAttendance: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2116
+ getAllAttendances: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2117
+ getAttendanceByUser: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2118
+ getAttendanceById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2119
+ checkOutAttendance: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2120
+ deleteAttendance: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2121
+ };
2122
+
2123
+ type TPlates = {
2124
+ plateNumber: string;
2125
+ recNo: string;
2126
+ };
2127
+ type TPerson = {
2128
+ _id?: ObjectId;
2129
+ name: string;
2130
+ contact?: string;
2131
+ nirc?: string;
2132
+ type?: PersonType;
2133
+ email?: string;
2134
+ block: number;
2135
+ level: string;
2136
+ unit: string;
2137
+ start?: string | Date;
2138
+ end?: string | Date;
2139
+ status?: string;
2140
+ nric?: string;
2141
+ remarks?: string;
2142
+ org: string | ObjectId;
2143
+ site: string | ObjectId;
2144
+ unitName?: string;
2145
+ companyName?: Array<string>;
2146
+ plates?: TPlates[];
2147
+ createdAt?: string | Date;
2148
+ updatedAt?: string | Date;
2149
+ deletedAt?: string | Date;
2150
+ };
2151
+ declare const PERSON_TYPES: readonly ["walk-in", "drop-off", "contractor", "delivery", "pick-up", "guest", "tenant", "resident"];
2152
+ type PersonType = (typeof PERSON_TYPES)[number];
2153
+ declare const schemaPlate: Joi.ObjectSchema<any>;
2154
+ declare const schemaPerson: Joi.ObjectSchema<any>;
2155
+ declare const schemaUpdatePerson: Joi.ObjectSchema<any>;
2156
+ declare function MPerson(value: TPerson): {
2157
+ _id: ObjectId | undefined;
2158
+ name: string;
2159
+ contact: string | undefined;
2160
+ block: number;
2161
+ level: string;
2162
+ unit: string;
2163
+ start: string | Date | undefined;
2164
+ end: string | Date | undefined;
2165
+ type: "resident" | "walk-in" | "drop-off" | "contractor" | "delivery" | "pick-up" | "guest" | "tenant" | undefined;
2166
+ email: string | undefined;
2167
+ status: string;
2168
+ nric: string | undefined;
2169
+ remarks: string | undefined;
2170
+ org: string | ObjectId;
2171
+ site: string | ObjectId;
2172
+ companyName: string[] | undefined;
2173
+ unitName: string | undefined;
2174
+ plates: TPlates[];
2175
+ createdAt: string | Date;
2176
+ updatedAt: string | Date | undefined;
2177
+ deletedAt: string | Date | undefined;
2178
+ };
2179
+
2180
+ type SiteType = (typeof PERSON_TYPES)[number];
2181
+ type TVisitorTransaction = {
2182
+ _id?: ObjectId;
2183
+ name?: string;
2184
+ type?: SiteType;
2185
+ company?: string;
2186
+ org?: string | ObjectId;
2187
+ site?: string | ObjectId;
2188
+ block?: number;
2189
+ level?: string;
2190
+ unit?: string | ObjectId;
2191
+ contact?: string;
2192
+ plateNumber?: string;
2193
+ checkIn?: string | Date;
2194
+ checkOut?: string | Date;
2195
+ status?: string;
2196
+ remarks?: string;
2197
+ deliveryType?: string;
2198
+ attachments?: string[];
2199
+ nric?: string;
2200
+ contractorType?: string;
2201
+ manualCheckout?: boolean;
2202
+ direction?: string;
2203
+ members?: {
2204
+ name: string;
2205
+ nric: string;
2206
+ visitorPass: string | null;
2207
+ contact: string;
2208
+ }[];
2209
+ visitorPass?: string | null;
2210
+ unitName?: string;
2211
+ createdAt?: string | Date;
2212
+ updatedAt?: string | Date;
2213
+ deletedAt?: string | Date;
2214
+ };
2215
+ declare const schemaVisitorTransaction: Joi.ObjectSchema<any>;
2216
+ declare const schemaUpdateVisTrans: Joi.ObjectSchema<any>;
2217
+ declare function MVisitorTransaction(value: TVisitorTransaction): {
2218
+ _id: ObjectId | undefined;
2219
+ name: string | undefined;
2220
+ type: "resident" | "walk-in" | "drop-off" | "contractor" | "delivery" | "pick-up" | "guest" | "tenant" | undefined;
2221
+ org: string | ObjectId | undefined;
2222
+ site: string | ObjectId | undefined;
2223
+ company: string | undefined;
2224
+ block: number | undefined;
2225
+ level: string | undefined;
2226
+ unit: string | ObjectId | undefined;
2227
+ contact: string | undefined;
2228
+ plateNumber: string | undefined;
2229
+ checkIn: string | Date;
2230
+ checkOut: string | Date | undefined;
2231
+ status: string;
2232
+ remarks: string | undefined;
2233
+ deliveryType: string | undefined;
2234
+ attachments: string[] | undefined;
2235
+ nric: string | undefined;
2236
+ contractorType: string | undefined;
2237
+ manualCheckout: boolean;
2238
+ direction: string | undefined;
2239
+ visitorPass: string | null | undefined;
2240
+ unitName: string | undefined;
2241
+ createdAt: string | Date;
2242
+ updatedAt: string | Date;
2243
+ deletedAt: string | Date;
2244
+ };
2245
+
2246
+ declare function useVisitorTransactionRepo(): {
2247
+ add: (value: TVisitorTransaction, session?: ClientSession) => Promise<ObjectId>;
2248
+ getAll: ({ search, page, limit, sort, status, org, site, dateTo, dateFrom, type, checkedOut, }: {
2249
+ search?: string | undefined;
2250
+ page?: number | undefined;
2251
+ limit?: number | undefined;
2252
+ sort?: Record<string, any> | undefined;
2253
+ status: string;
2254
+ org?: string | undefined;
2255
+ site?: string | undefined;
2256
+ dateTo?: string | undefined;
2257
+ dateFrom?: string | undefined;
2258
+ type?: string | undefined;
2259
+ checkedOut?: string | undefined;
2260
+ }, session?: ClientSession) => Promise<{}>;
2261
+ getOpenByPlateNumber: (plateNumber: string) => Promise<TVisitorTransaction | null>;
2262
+ updateById: (_id: string | ObjectId, value: Partial<TVisitorTransaction>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2263
+ deleteVisitorTransaction: (_id: string | ObjectId) => Promise<number>;
2264
+ createTextIndex: () => Promise<void>;
2265
+ };
2266
+
2267
+ declare function useVisitorTransactionService(): {
2268
+ add: (value: TVisitorTransaction) => Promise<string>;
2269
+ updateById: (id: string | ObjectId, value: TVisitorTransaction) => Promise<string>;
2270
+ };
2271
+
2272
+ declare function useVisitorTransactionController(): {
2273
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2274
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2275
+ updateVisitorTansactionById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2276
+ deleteVisitorTransaction: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2277
+ };
2278
+
2279
+ type TGuestManagement = {
2280
+ _id?: ObjectId;
2281
+ name: string;
2282
+ contact?: string;
2283
+ nirc?: string;
2284
+ type?: string;
2285
+ email?: string;
2286
+ block: string;
2287
+ level: string;
2288
+ unit: string;
2289
+ start: string | Date;
2290
+ end: string | Date;
2291
+ status?: string;
2292
+ nric?: string;
2293
+ remarks?: string;
2294
+ org: string | ObjectId;
2295
+ site: string | ObjectId;
2296
+ plateNumber?: string;
2297
+ unitName?: string;
2298
+ createdAt?: string | Date;
2299
+ updatedAt?: string | Date;
2300
+ deletedAt?: string | Date;
2301
+ };
2302
+ declare const schemaGuestManagement: Joi.ObjectSchema<any>;
2303
+ declare const schemaUpdateGuestManagement: Joi.ObjectSchema<any>;
2304
+ declare function MGuestManagement(value: TGuestManagement): {
2305
+ _id: ObjectId | undefined;
2306
+ name: string;
2307
+ contact: string | undefined;
2308
+ block: string;
2309
+ level: string;
2310
+ unit: string;
2311
+ start: string | Date;
2312
+ end: string | Date;
2313
+ status: string;
2314
+ nric: string | undefined;
2315
+ remarks: string | undefined;
2316
+ org: string | ObjectId;
2317
+ site: string | ObjectId;
2318
+ plateNumber: string | undefined;
2319
+ unitName: string | undefined;
2320
+ createdAt: string | Date;
2321
+ updatedAt: string | Date | undefined;
2322
+ deletedAt: string | Date | undefined;
2323
+ };
2324
+
2325
+ declare function useGuestManagementRepo(): {
2326
+ add: (value: TGuestManagement, session?: ClientSession) => Promise<ObjectId>;
2327
+ getAll: ({ search, page, limit, sort, status, dateFrom, dateTo, org, site, }: {
2328
+ search?: string | undefined;
2329
+ page?: number | undefined;
2330
+ limit?: number | undefined;
2331
+ sort?: Record<string, any> | undefined;
2332
+ status: string;
2333
+ dateFrom?: string | undefined;
2334
+ dateTo?: string | undefined;
2335
+ org?: string | undefined;
2336
+ site?: string | undefined;
2337
+ }, session?: ClientSession) => Promise<{}>;
2338
+ updateVisitorGuestById: (_id: string | ObjectId, value: Partial<TGuestManagement>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2339
+ deleteVisitorGuest: (_id: string | ObjectId) => Promise<number>;
2340
+ createTextIndex: () => Promise<void>;
2341
+ };
2342
+
2343
+ declare function useGuestManagementService(): {
2344
+ add: (value: TGuestManagement) => Promise<string>;
2345
+ updateVisitorGuestById: (id: string | ObjectId, value: TGuestManagement) => Promise<string>;
2346
+ };
2347
+
2348
+ declare function useGuestManagementController(): {
2349
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2350
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2351
+ updateVisitorGuestById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2352
+ deleteVisitorGuest: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2353
+ };
2354
+
2355
+ declare function usePersonRepo(): {
2356
+ add: (value: TPerson, session?: ClientSession) => Promise<ObjectId>;
2357
+ getAll: ({ search, page, limit, sort, status, dateFrom, dateTo, org, site, type, }: {
2358
+ search?: string | undefined;
2359
+ page?: number | undefined;
2360
+ limit?: number | undefined;
2361
+ sort?: Record<string, any> | undefined;
2362
+ status: string;
2363
+ dateFrom?: string | undefined;
2364
+ dateTo?: string | undefined;
2365
+ org?: string | undefined;
2366
+ site?: string | undefined;
2367
+ type?: string | undefined;
2368
+ }, session?: ClientSession) => Promise<{}>;
2369
+ updateById: (_id: string | ObjectId, value: Partial<TPerson>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2370
+ deleteById: (_id: string | ObjectId) => Promise<number>;
2371
+ getById: (_id: string | ObjectId) => Promise<TPerson | null>;
2372
+ createTextIndex: () => Promise<void>;
2373
+ getPersonByPlateNumber: (plateNumber: string) => Promise<TPerson | null>;
2374
+ getByNRIC: (value: string) => Promise<TPerson | null>;
2375
+ createIndex: () => Promise<void>;
2376
+ getPersonByPhoneNumber: (value: string) => Promise<TPerson | null>;
2377
+ getPeopleByUnit: ({ status, type, unit, }: {
2378
+ status: string;
2379
+ type: string;
2380
+ unit?: string | undefined;
2381
+ }, session?: ClientSession) => Promise<TPerson[]>;
2382
+ getCompany: (search?: string) => Promise<any[] | TPerson>;
2383
+ getPeopleByPlateNumber: (plateNumber: string) => Promise<TPerson[]>;
2384
+ };
2385
+
2386
+ declare function usePersonController(): {
2387
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2388
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2389
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2390
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2391
+ getByNRIC: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2392
+ getPersonByPhoneNumber: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2393
+ getPeopleByUnit: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2394
+ getCompany: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2395
+ getPeopleByPlateNumber: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2396
+ };
2397
+
2398
+ type TRobotMetadata = {
2399
+ orgId?: string | ObjectId;
2400
+ siteId?: string | ObjectId;
2401
+ administratorId?: string | ObjectId;
2402
+ };
2403
+ type TRobot = {
2404
+ _id?: ObjectId;
2405
+ name: string;
2406
+ appKey: string;
2407
+ appToken: string;
2408
+ createdBy: string | ObjectId;
2409
+ createdByName: string;
2410
+ status?: string;
2411
+ metadata?: TRobotMetadata;
2412
+ createdAt?: Date;
2413
+ updatedAt?: string | Date;
2414
+ deletedAt?: string | Date;
2415
+ };
2416
+ declare const robotSchema: Joi.ObjectSchema<any>;
2417
+ declare function MRobot(value: TRobot): {
2418
+ name: string;
2419
+ appKey: string;
2420
+ appToken: string;
2421
+ createdBy: string | ObjectId;
2422
+ createdByName: string;
2423
+ metadata: {
2424
+ orgId: string | ObjectId;
2425
+ siteId: string | ObjectId;
2426
+ administratorId: string | ObjectId;
2427
+ };
2428
+ status: string;
2429
+ createdAt: Date;
2430
+ updatedAt: string | Date;
2431
+ deletedAt: string | Date;
2432
+ };
2433
+
2434
+ declare function useRobotRepo(): {
2435
+ createIndex: () => Promise<void>;
2436
+ createTextIndex: () => Promise<void>;
2437
+ createRobot: (value: TRobot, session?: ClientSession) => Promise<ObjectId>;
2438
+ getRobots: ({ search, page, limit, sort, organization, site, status, from, to, }: {
2439
+ search?: string | undefined;
2440
+ page?: number | undefined;
2441
+ limit?: number | undefined;
2442
+ sort?: Record<string, any> | undefined;
2443
+ organization: string | ObjectId;
2444
+ site: string | ObjectId;
2445
+ status?: string | undefined;
2446
+ from?: string | undefined;
2447
+ to?: string | undefined;
2448
+ }) => Promise<{
2449
+ items: any[];
2450
+ pages: number;
2451
+ pageRange: string;
2452
+ } | TRobot>;
2453
+ };
2454
+
2455
+ declare function useRobotService(): {
2456
+ createRobot: (value: TRobot) => Promise<ObjectId>;
2457
+ getRobots: ({ search, page, limit, sort, organization, site, status, from, to, }: {
2458
+ search?: string | undefined;
2459
+ page?: number | undefined;
2460
+ limit?: number | undefined;
2461
+ sort?: Record<string, any> | undefined;
2462
+ organization: string;
2463
+ site: string;
2464
+ status: string;
2465
+ serviceProvider?: string | undefined;
2466
+ from?: string | undefined;
2467
+ to?: string | undefined;
2468
+ }) => Promise<{
2469
+ items: any[];
2470
+ pages: number;
2471
+ pageRange: string;
2472
+ } | TRobot>;
2473
+ };
2474
+
2475
+ declare function useRobotController(): {
2476
+ createRobot: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2477
+ getRobots: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2478
+ };
2479
+
2480
+ type TPatrolQuestion = {
2481
+ _id?: ObjectId;
2482
+ site: string | ObjectId;
2483
+ question: string;
2484
+ answers: Array<string>;
2485
+ status: string;
2486
+ createdAt?: Date | string;
2487
+ updatedAt?: Date | string;
2488
+ deletedAt?: Date | string;
2489
+ };
2490
+ declare const schemaPatrolQuestion: Joi.ObjectSchema<any>;
2491
+ declare const schemaUpdatePatrolQuestion: Joi.ObjectSchema<any>;
2492
+ declare function MPatrolQuestion(value: TPatrolQuestion): {
2493
+ _id: ObjectId;
2494
+ site: ObjectId;
2495
+ question: string;
2496
+ answers: string[];
2497
+ status: string;
2498
+ createdAt: string | Date;
2499
+ updatedAt: string | Date;
2500
+ deletedAt: string | Date;
2501
+ };
2502
+
2503
+ declare function usePatrolQuestionRepo(): {
2504
+ createIndexes: () => Promise<string>;
2505
+ createTextIndex: () => Promise<string>;
2506
+ add: (value: TPatrolQuestion, session?: ClientSession) => Promise<ObjectId>;
2507
+ getAll: ({ search, page, limit, sort, status, site, }: {
2508
+ search?: string | undefined;
2509
+ page?: number | undefined;
2510
+ limit?: number | undefined;
2511
+ sort?: Record<string, any> | undefined;
2512
+ status: string;
2513
+ site?: string | undefined;
2514
+ }, session?: ClientSession) => Promise<{}>;
2515
+ updateById: (_id: string | ObjectId, value: Partial<TPatrolQuestion>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2516
+ deleteById: (_id: string | ObjectId) => Promise<number>;
2517
+ getById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TPatrolQuestion | null>;
2518
+ };
2519
+
2520
+ declare function usePatrolQuestionController(): {
2521
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2522
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2523
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2524
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2525
+ };
2526
+
2527
+ type Camera = {
2528
+ camera: string | ObjectId;
2529
+ url: string;
2530
+ questions: Array<{
2531
+ questionId: string | ObjectId;
2532
+ question: string;
2533
+ answers: Array<string>;
2534
+ }>;
2535
+ };
2536
+ type TPatrolRoute = {
2537
+ _id?: ObjectId;
2538
+ site: string | ObjectId;
2539
+ name: string;
2540
+ assignee: ObjectId[];
2541
+ start: string;
2542
+ end: string;
2543
+ repeat: Array<number>;
2544
+ cameras: Camera[];
2545
+ status: string;
2546
+ gracePeriod?: number;
2547
+ createdAt?: Date | string;
2548
+ updatedAt?: Date | string;
2549
+ deletedAt?: Date | string;
2550
+ };
2551
+ declare const schemeCamera: Joi.ObjectSchema<any>;
2552
+ declare const schemaPatrolRoute: Joi.ObjectSchema<any>;
2553
+ declare const schemaUpdatePatrolRoute: Joi.ObjectSchema<any>;
2554
+ declare function MPatrolRoute(value: TPatrolRoute): {
2555
+ _id: ObjectId;
2556
+ site: ObjectId;
2557
+ name: string;
2558
+ assignee: ObjectId[];
2559
+ start: string;
2560
+ end: string;
2561
+ repeat: number[];
2562
+ cameras: Camera[];
2563
+ status: string;
2564
+ createdAt: string | Date;
2565
+ gracePeriod: number;
2566
+ updatedAt: string | Date;
2567
+ deletedAt: string | Date;
2568
+ };
2569
+
2570
+ declare function usePatrolRouteRepo(): {
2571
+ createTextIndex: () => Promise<string>;
2572
+ add: (value: TPatrolRoute, session?: ClientSession) => Promise<ObjectId>;
2573
+ getAll: ({ search, page, limit, sort, status, site, }: {
2574
+ search?: string | undefined;
2575
+ page?: number | undefined;
2576
+ limit?: number | undefined;
2577
+ sort?: Record<string, any> | undefined;
2578
+ status: string;
2579
+ site?: string | undefined;
2580
+ }, session?: ClientSession) => Promise<{}>;
2581
+ updateById: (_id: string | ObjectId, value: Partial<TPatrolRoute>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2582
+ deleteById: (_id: string | ObjectId) => Promise<number>;
2583
+ getScheduledRoute: ({ search, page, limit, sort, status, site, start, day, }: {
2584
+ search?: string | undefined;
2585
+ page?: number | undefined;
2586
+ limit?: number | undefined;
2587
+ sort?: Record<string, any> | undefined;
2588
+ status: string;
2589
+ site: string;
2590
+ start: string;
2591
+ day: number;
2592
+ }, session?: ClientSession) => Promise<{}>;
2593
+ };
2594
+
2595
+ declare function usePatrolRouteController(): {
2596
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2597
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2598
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2599
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2600
+ getScheduledRoute: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2601
+ };
2602
+
2603
+ type logCamera = {
2604
+ camera: string | ObjectId;
2605
+ url: string;
2606
+ start: string;
2607
+ end: string;
2608
+ duration: number;
2609
+ questions: Array<{
2610
+ questionId: string | ObjectId;
2611
+ question: string;
2612
+ answers: Array<string>;
2613
+ remarks: string;
2614
+ photos: string;
2615
+ video: string;
2616
+ }>;
2617
+ };
2618
+ type TPatrolLog = {
2619
+ _id?: ObjectId;
2620
+ route?: string | ObjectId;
2621
+ site: string | ObjectId;
2622
+ name: string;
2623
+ assignee: Array<string | ObjectId>;
2624
+ start: string;
2625
+ end: string;
2626
+ cameras: Array<logCamera>;
2627
+ status: Array<string>;
2628
+ createdAt?: Date | string;
2629
+ updatedAt?: Date | string;
2630
+ deletedAt?: Date | string;
2631
+ };
2632
+ declare const schemeLogCamera: Joi.ObjectSchema<any>;
2633
+ declare const schemaPatrolLog: Joi.ObjectSchema<any>;
2634
+ declare const schemaUpdatePatrolLog: Joi.ObjectSchema<any>;
2635
+ declare function MPatrolLog(value: TPatrolLog): {
2636
+ _id: ObjectId;
2637
+ site: string | ObjectId;
2638
+ name: string;
2639
+ assignee: ObjectId[];
2640
+ start: string;
2641
+ end: string;
2642
+ cameras: logCamera[];
2643
+ status: string[];
2644
+ route: string | ObjectId | undefined;
2645
+ createdAt: string | Date;
2646
+ updatedAt: string | Date;
2647
+ deletedAt: string | Date;
2648
+ };
2649
+
2650
+ declare function usePatrolLogRepo(): {
2651
+ createIndexes: () => Promise<string>;
2652
+ createTextIndex: () => Promise<string>;
2653
+ add: (value: TPatrolLog, session?: ClientSession) => Promise<ObjectId>;
2654
+ getAll: ({ search, page, limit, sort, status, site, }: {
2655
+ search?: string | undefined;
2656
+ page?: number | undefined;
2657
+ limit?: number | undefined;
2658
+ sort?: Record<string, any> | undefined;
2659
+ status: string;
2660
+ site?: string | undefined;
2661
+ }, session?: ClientSession) => Promise<{}>;
2662
+ updateById: (_id: string | ObjectId, value: Partial<TPatrolLog>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2663
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
2664
+ };
2665
+
2666
+ declare function usePatrolLogController(): {
2667
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2668
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2669
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2670
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2671
+ };
2672
+
2673
+ type TimeSlot = {
2674
+ start?: string;
2675
+ end?: string;
2676
+ }[];
2677
+ type DayStructure = {
2678
+ enabled?: boolean;
2679
+ start?: string;
2680
+ end?: string;
2681
+ timeSlots?: TimeSlot;
2682
+ breakTimes?: TimeSlot;
2683
+ peakTimes?: TimeSlot;
2684
+ };
2685
+ type TSiteFacility = {
2686
+ _id?: ObjectId;
2687
+ site?: string | ObjectId;
2688
+ name?: string;
2689
+ icon?: string;
2690
+ featuredImage?: string | ObjectId;
2691
+ gallery?: string[] | ObjectId[];
2692
+ hourInterval?: number;
2693
+ monday?: DayStructure;
2694
+ tuesday?: DayStructure;
2695
+ wednesday?: DayStructure;
2696
+ thursday?: DayStructure;
2697
+ friday?: DayStructure;
2698
+ saturday?: DayStructure;
2699
+ sunday?: DayStructure;
2700
+ description?: string;
2701
+ rulesAndPolicies?: string;
2702
+ advanceBookingDays?: string;
2703
+ bookingAmount?: number;
2704
+ bookingCurrency?: {
2705
+ code?: string;
2706
+ symbol?: string;
2707
+ taxType?: string;
2708
+ };
2709
+ bookingFeeGuestAmount?: number;
2710
+ bookingFeeRefundPercentage?: number;
2711
+ bookingPolicy?: string;
2712
+ bookingTaxPercentage?: {
2713
+ bookingFee?: number;
2714
+ damaged?: number;
2715
+ };
2716
+ depositAmount?: number;
2717
+ depositCurrency?: string;
2718
+ isBookingFeeEnabled?: boolean;
2719
+ isBookingPolicyEnabled?: boolean;
2720
+ isCancellationAutoRefundEnabled?: boolean;
2721
+ isDamagedPolicyEnabled?: boolean;
2722
+ isDepositEnabled?: boolean;
2723
+ isGuestEnabled?: boolean;
2724
+ maintenanceDates?: Date[] | string[];
2725
+ maintenanceDatesWithTimes?: {
2726
+ date?: Date | string;
2727
+ times?: string[];
2728
+ }[];
2729
+ maintenanceMonthly?: (string | number)[];
2730
+ maintenanceWeekly?: string[];
2731
+ pax?: boolean;
2732
+ peakBookingFeeAmount?: number;
2733
+ peakBookingFeeGuestAmount?: number;
2734
+ refundFrom?: number;
2735
+ refundTo?: number;
2736
+ securityCheckList?: {
2737
+ description?: string;
2738
+ count?: number;
2739
+ permanentRemarks?: string;
2740
+ }[];
2741
+ damagedPolicy?: string;
2742
+ status?: string;
2743
+ createdAt?: Date | string;
2744
+ updatedAt?: Date | string;
2745
+ deletedAt?: Date | string;
2746
+ };
2747
+ declare const schemaSiteFacility: Joi.ObjectSchema<any>;
2748
+ declare const schemaUpdateSiteFacility: Joi.ObjectSchema<any>;
2749
+ declare function MSiteFacility(value: TSiteFacility): {
2750
+ status: string;
2751
+ createdAt: string | Date;
2752
+ updatedAt: string | Date | undefined;
2753
+ deletedAt: string | Date | undefined;
2754
+ monday: DayStructure | undefined;
2755
+ tuesday: DayStructure | undefined;
2756
+ wednesday: DayStructure | undefined;
2757
+ thursday: DayStructure | undefined;
2758
+ friday: DayStructure | undefined;
2759
+ saturday: DayStructure | undefined;
2760
+ sunday: DayStructure | undefined;
2761
+ _id: ObjectId | undefined;
2762
+ site: string | ObjectId | undefined;
2763
+ name: string;
2764
+ icon: string;
2765
+ featuredImage: string | ObjectId;
2766
+ gallery: ObjectId[];
2767
+ hourInterval: number;
2768
+ description: string;
2769
+ rulesAndPolicies: string;
2770
+ advanceBookingDays: string;
2771
+ bookingAmount: number;
2772
+ bookingCurrency: {
2773
+ code?: string | undefined;
2774
+ symbol?: string | undefined;
2775
+ taxType?: string | undefined;
2776
+ };
2777
+ bookingFeeGuestAmount: number;
2778
+ bookingFeeRefundPercentage: number;
2779
+ bookingPolicy: string;
2780
+ bookingTaxPercentage: {
2781
+ bookingFee?: number | undefined;
2782
+ damaged?: number | undefined;
2783
+ };
2784
+ depositAmount: number;
2785
+ depositCurrency: string;
2786
+ isBookingFeeEnabled: boolean;
2787
+ isBookingPolicyEnabled: boolean;
2788
+ isCancellationAutoRefundEnabled: boolean;
2789
+ isDamagedPolicyEnabled: boolean;
2790
+ isDepositEnabled: boolean;
2791
+ isGuestEnabled: boolean;
2792
+ maintenanceDates: string[];
2793
+ maintenanceDatesWithTimes: {
2794
+ date?: string | Date | undefined;
2795
+ times?: string[] | undefined;
2796
+ }[];
2797
+ maintenanceMonthly: (string | number)[];
2798
+ maintenanceWeekly: string[];
2799
+ pax: boolean;
2800
+ peakBookingFeeAmount: number;
2801
+ peakBookingFeeGuestAmount: number;
2802
+ refundFrom: number;
2803
+ refundTo: number;
2804
+ securityCheckList: {
2805
+ description?: string | undefined;
2806
+ count?: number | undefined;
2807
+ permanentRemarks?: string | undefined;
2808
+ }[];
2809
+ damagedPolicy: string;
2810
+ };
2811
+
2812
+ declare function useSiteFacilityRepo(): {
2813
+ add: (value: TSiteFacility, session?: ClientSession) => Promise<ObjectId>;
2814
+ getAll: ({ search, page, limit, sort, site, status, }: {
2815
+ search?: string | undefined;
2816
+ page?: number | undefined;
2817
+ limit?: number | undefined;
2818
+ sort?: Record<string, any> | undefined;
2819
+ site?: string | ObjectId | undefined;
2820
+ status?: string | undefined;
2821
+ }, session?: ClientSession) => Promise<{
2822
+ items: any[];
2823
+ pages: number;
2824
+ pageRange: string;
2825
+ } | TSiteFacility>;
2826
+ getSiteFacilityById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TSiteFacility>;
2827
+ getSiteFacilityTimeSlotById: (_id: string | ObjectId, site: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TSiteFacility>;
2828
+ updateSiteFacilityById: (_id: ObjectId | string, value: Partial<TSiteFacility>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2829
+ createTextIndex: () => Promise<void>;
2830
+ createIndexes: () => Promise<void>;
2831
+ deleteSiteFacilityById: (_id: string | ObjectId) => Promise<number>;
2832
+ };
2833
+
2834
+ declare function useSiteFacilityService(): {
2835
+ add: (value: TSiteFacility) => Promise<{
2836
+ _id: ObjectId;
2837
+ }>;
2838
+ getSiteFacilityTimeSlotById: (_id: string | ObjectId, date: string, site: string | ObjectId) => Promise<string[]>;
2839
+ updateSiteFacilityById: (id: string | ObjectId, value: Partial<TSiteFacility>) => Promise<string>;
2840
+ };
2841
+
2842
+ declare function useSiteFacilityController(): {
2843
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2844
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2845
+ getSiteFacilityById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2846
+ getSiteFacilityTimeSlotById: (req: Request, res: Response, next: NextFunction) => Promise<void | Response<any, Record<string, any>>>;
2847
+ updateSiteFacilityById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2848
+ deleteSiteFacilityById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2849
+ };
2850
+
2851
+ type TServiceProviderBilling = {
2852
+ _id?: ObjectId;
2853
+ attachments: string[];
2854
+ acknowledgedBy: {
2855
+ name: string;
2856
+ user: ObjectId;
2857
+ }[];
2858
+ status: string;
2859
+ orgId: ObjectId;
2860
+ createdAt?: Date | string;
2861
+ updatedAt?: Date | string;
2862
+ deletedAt?: Date | string;
2863
+ };
2864
+ declare const schemaServiceProviderBilling: Joi.ObjectSchema<any>;
2865
+ declare const schemaUpdateServiceProviderBilling: Joi.ObjectSchema<any>;
2866
+ declare function MServiceProviderBilling(value: TServiceProviderBilling): {
2867
+ _id: ObjectId;
2868
+ attachments: string[];
2869
+ acknowledgedBy: {
2870
+ name: string;
2871
+ user: ObjectId;
2872
+ }[];
2873
+ status: string;
2874
+ orgId: ObjectId;
2875
+ createdAt: string | Date;
2876
+ updatedAt: string | Date | undefined;
2877
+ deletedAt: string | Date | undefined;
2878
+ };
2879
+
2880
+ declare function useServiceProviderBillingRepo(): {
2881
+ add: (value: TServiceProviderBilling, session?: ClientSession) => Promise<ObjectId>;
2882
+ getAll: ({ search, page, limit, sort, org, status, }: {
2883
+ search?: string | undefined;
2884
+ page?: number | undefined;
2885
+ limit?: number | undefined;
2886
+ sort?: Record<string, any> | undefined;
2887
+ org: string | ObjectId;
2888
+ status: string;
2889
+ }, session?: ClientSession) => Promise<{
2890
+ items: any[];
2891
+ pages: number;
2892
+ pageRange: string;
2893
+ } | TServiceProviderBilling>;
2894
+ getSiteServiceProviderBillingById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TServiceProviderBilling>;
2895
+ updateServiceProviderBillingById: (_id: ObjectId | string, value: Partial<TServiceProviderBilling>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2896
+ deleteServiceProviderBillingById: (_id: string | ObjectId) => Promise<number>;
2897
+ createIndexes: () => Promise<void>;
2898
+ };
2899
+
2900
+ declare function useServiceProviderBillingService(): {
2901
+ add: (value: TServiceProviderBilling) => Promise<string>;
2902
+ updateServiceProviderBillingById: (id: string | ObjectId, value: Partial<TServiceProviderBilling>) => Promise<string>;
2903
+ };
2904
+
2905
+ declare function useServiceProviderBillingController(): {
2906
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2907
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2908
+ getServiceProviderBillingById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2909
+ updateServiceProviderBillingById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2910
+ deleteServiceProviderBillingById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2911
+ };
2912
+
2913
+ type TSiteFacilityBooking = {
2914
+ _id?: ObjectId;
2915
+ facility?: string;
2916
+ slot?: string;
2917
+ slotName?: string;
2918
+ user?: string | ObjectId;
2919
+ site?: string | ObjectId;
2920
+ pax?: number;
2921
+ date?: string | Date;
2922
+ status?: string;
2923
+ invites?: {
2924
+ email?: string;
2925
+ name?: string;
2926
+ isOvernightParking?: boolean;
2927
+ }[];
2928
+ remarks?: string;
2929
+ bookingAmount?: number;
2930
+ depositAmount?: number;
2931
+ bookingFeeRefundPercentage?: number;
2932
+ company?: string | null;
2933
+ fullName?: string | null;
2934
+ email?: string | null;
2935
+ phoneNumber?: string | null;
2936
+ block?: string;
2937
+ level?: string;
2938
+ unit?: string;
2939
+ bookingPolicy?: string;
2940
+ memberId?: string | null;
2941
+ bookingFeeTitle?: string;
2942
+ bookedFrom?: string;
2943
+ notes?: string | null;
2944
+ facilityName?: string;
2945
+ refundFrom?: number;
2946
+ refundTo?: number;
2947
+ securityCheckList?: string[];
2948
+ userGivenName?: string;
2949
+ userSurname?: string;
2950
+ createdByGivenName?: string;
2951
+ createdBySurname?: string;
2952
+ createdByType?: string;
2953
+ userBlockName?: string;
2954
+ refundTransaction?: {
2955
+ order_number?: string;
2956
+ amount?: number;
2957
+ mid?: string;
2958
+ timestamp?: string;
2959
+ currency?: string;
2960
+ q_timestamp?: string;
2961
+ q_settle_time?: string;
2962
+ q_customer_name?: string;
2963
+ reason_code?: number;
2964
+ description?: string;
2965
+ result_status?: string;
2966
+ createdAt?: string | Date;
2967
+ };
2968
+ review?: {
2969
+ damagedAmount?: number;
2970
+ refundableAmount?: number;
2971
+ topUpAmount?: number;
2972
+ remarks?: string;
2973
+ };
2974
+ bookingPayment?: {
2975
+ transaction_id?: string;
2976
+ amount?: string | number;
2977
+ payer?: string;
2978
+ ref_id?: string;
2979
+ mkey?: string;
2980
+ mid?: string | number;
2981
+ pmethod?: string;
2982
+ createdAt?: string | Date;
2983
+ };
2984
+ bookingTaxPercentage?: {
2985
+ bookingFee?: number;
2986
+ damaged?: number;
2987
+ };
2988
+ bookingCurrency?: {
2989
+ symbol?: string;
2990
+ code?: string;
2991
+ taxType?: string;
2992
+ };
2993
+ approvedBy?: ObjectId | string | null;
2994
+ createdBy?: ObjectId | string;
2995
+ updatedBy?: ObjectId | string;
2996
+ createdAt?: Date | string;
2997
+ updatedAt?: Date | string;
2998
+ deletedAt?: Date | string;
2999
+ };
3000
+ declare const schemaSiteFacilityBooking: Joi.ObjectSchema<any>;
3001
+ declare function MSiteFacilityBooking(value: TSiteFacilityBooking): {
3002
+ _id: ObjectId;
3003
+ facility: string;
3004
+ slot: string;
3005
+ slotName: string;
3006
+ user: string | ObjectId;
3007
+ site: string | ObjectId;
3008
+ pax: number;
3009
+ date: string | Date;
3010
+ status: string;
3011
+ invites: {
3012
+ email?: string | undefined;
3013
+ name?: string | undefined;
3014
+ isOvernightParking?: boolean | undefined;
3015
+ }[];
3016
+ remarks: string;
3017
+ bookingAmount: number;
3018
+ depositAmount: number;
3019
+ bookingFeeRefundPercentage: number;
3020
+ company: string | null;
3021
+ fullName: string | null;
3022
+ email: string | null;
3023
+ phoneNumber: string | null;
3024
+ block: string;
3025
+ level: string;
3026
+ unit: string;
3027
+ bookingPolicy: string;
3028
+ memberId: string | null;
3029
+ bookingFeeTitle: string;
3030
+ bookedFrom: string;
3031
+ notes: string | null;
3032
+ facilityName: string;
3033
+ refundFrom: number;
3034
+ refundTo: number;
3035
+ securityCheckList: string[];
3036
+ userGivenName: string;
3037
+ userSurname: string;
3038
+ createdByGivenName: string;
3039
+ createdBySurname: string;
3040
+ createdByType: string;
3041
+ userBlockName: string;
3042
+ refundTransaction: {
3043
+ order_number: string;
3044
+ amount: number;
3045
+ mid: string;
3046
+ timestamp: string;
3047
+ currency: string;
3048
+ q_timestamp: string;
3049
+ q_settle_time: string;
3050
+ q_customer_name: string;
3051
+ reason_code: number;
3052
+ description: string;
3053
+ result_status: string;
3054
+ createdAt: string | Date;
3055
+ } | undefined;
3056
+ review: {
3057
+ damagedAmount: number;
3058
+ refundableAmount: number;
3059
+ topUpAmount: number;
3060
+ remarks: string;
3061
+ } | undefined;
3062
+ bookingPayment: {
3063
+ transaction_id: string;
3064
+ amount: string | number;
3065
+ payer: string;
3066
+ ref_id: string;
3067
+ mkey: string;
3068
+ mid: string | number;
3069
+ pmethod: string;
3070
+ createdAt: string | Date;
3071
+ } | undefined;
3072
+ bookingTaxPercentage: {
3073
+ bookingFee: number;
3074
+ damaged: number;
3075
+ } | undefined;
3076
+ bookingCurrency: {
3077
+ symbol: string;
3078
+ code: string;
3079
+ taxType: string;
3080
+ } | undefined;
3081
+ approvedBy: string | ObjectId | null | undefined;
3082
+ createdBy: string | ObjectId | undefined;
3083
+ updatedBy: string | ObjectId | undefined;
3084
+ createdAt: string | Date;
3085
+ updatedAt: string | Date | undefined;
3086
+ deletedAt: string | Date | undefined;
3087
+ };
3088
+
3089
+ declare function useSiteFacilityBookingRepo(): {
3090
+ add: (value: TSiteFacilityBooking, session?: ClientSession) => Promise<ObjectId>;
3091
+ getAll: ({ search, page, limit, sort, site, status, }: {
3092
+ search?: string | undefined;
3093
+ page?: number | undefined;
3094
+ limit?: number | undefined;
3095
+ sort?: Record<string, any> | undefined;
3096
+ site: string | ObjectId;
3097
+ status: string;
3098
+ }, session?: ClientSession) => Promise<{
3099
+ items: any[];
3100
+ pages: number;
3101
+ pageRange: string;
3102
+ } | TSiteFacilityBooking>;
3103
+ getSiteFacilityBookingById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TSiteFacilityBooking>;
3104
+ updateSiteFacilityBookingById: (_id: ObjectId | string, value: Partial<TSiteFacilityBooking>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3105
+ deleteSiteFacilityBookingById: (_id: string | ObjectId) => Promise<number>;
3106
+ createIndexes: () => Promise<void>;
3107
+ };
3108
+
3109
+ declare function useSiteFacilityBookingService(): {
3110
+ add: (value: TSiteFacilityBooking) => Promise<string>;
3111
+ updateSiteFacilityBookingById: (id: string | ObjectId, value: Partial<TSiteFacilityBooking>) => Promise<string>;
3112
+ };
3113
+
3114
+ declare function useSiteFacilityBookingController(): {
3115
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3116
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3117
+ getSiteFacilityBookingById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3118
+ updateSiteFacilityBookingById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3119
+ deleteSiteFacilityBookingById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3120
+ };
3121
+
3122
+ type TDocumentManagement = {
3123
+ _id?: ObjectId;
3124
+ name: string;
3125
+ type?: string;
3126
+ attachment: string;
3127
+ status: string;
3128
+ org?: string | ObjectId;
3129
+ site?: string | ObjectId;
3130
+ createdBy: string | ObjectId;
3131
+ updatedBy?: string | ObjectId;
3132
+ createdAt?: string | Date;
3133
+ updatedAt?: string | Date;
3134
+ };
3135
+ declare const schemaDocumentManagement: Joi.ObjectSchema<any>;
3136
+ declare const schemaUpdateDocumentManagement: Joi.ObjectSchema<any>;
3137
+ declare function MDocumentManagement(value: TDocumentManagement): {
3138
+ _id: ObjectId | undefined;
3139
+ name: string;
3140
+ type: string | undefined;
3141
+ attachment: string;
3142
+ status: string;
3143
+ org: string | ObjectId | undefined;
3144
+ site: string | ObjectId | undefined;
3145
+ createdBy: string | ObjectId;
3146
+ updatedBy: string | ObjectId | undefined;
3147
+ createdAt: string | Date;
3148
+ updatedAt: string | Date;
3149
+ };
3150
+
3151
+ declare function useDocumentManagementRepo(): {
3152
+ createTextIndex: () => Promise<void>;
3153
+ add: (value: TDocumentManagement, session?: ClientSession) => Promise<ObjectId>;
3154
+ getAll: ({ search, page, limit, sort, status, org, site, }: {
3155
+ search?: string | undefined;
3156
+ page?: number | undefined;
3157
+ limit?: number | undefined;
3158
+ sort?: Record<string, any> | undefined;
3159
+ status: string;
3160
+ org?: string | undefined;
3161
+ site?: string | undefined;
3162
+ }) => Promise<{
3163
+ items: any[];
3164
+ pages: number;
3165
+ pageRange: string;
3166
+ } | TDocumentManagement>;
3167
+ getDocumentById: (_id: string | ObjectId) => Promise<bson.Document>;
3168
+ updateDocumentById: (_id: string | ObjectId, value: TDocumentManagement) => Promise<number>;
3169
+ deleteDocumentById: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
3170
+ getDocumentManagementBySiteId: (site: string | ObjectId, type?: string) => Promise<bson.Document[] | TDocumentManagement>;
3171
+ };
3172
+
3173
+ declare function useDocumentManagementService(): {
3174
+ createDocument: (value: TDocumentManagement) => Promise<string>;
3175
+ getDocuments: ({ search, page, limit, sort, status, org, site, }: {
3176
+ search?: string | undefined;
3177
+ page?: number | undefined;
3178
+ limit?: number | undefined;
3179
+ sort?: Record<string, any> | undefined;
3180
+ site?: string | undefined;
3181
+ status: string;
3182
+ org?: string | undefined;
3183
+ }) => Promise<{
3184
+ items: any[];
3185
+ pages: number;
3186
+ pageRange: string;
3187
+ } | TDocumentManagement>;
3188
+ };
3189
+
3190
+ declare function useDocumentManagementController(): {
3191
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3192
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3193
+ getDocumentById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3194
+ updateDocumentById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3195
+ deleteDocumentById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3196
+ getDocumentsBySiteId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3197
+ };
3198
+
3199
+ type TBulletinBoard = {
3200
+ _id?: ObjectId;
3201
+ site?: string | ObjectId;
3202
+ orgId?: string | ObjectId;
3203
+ recipients?: Array<"admin" | "organization" | "site" | "service-provider" | "service-provider-member" | "resident">;
3204
+ title?: string;
3205
+ content?: string;
3206
+ file?: Array<{
3207
+ _id?: string | ObjectId;
3208
+ name?: string;
3209
+ preview?: boolean;
3210
+ }>;
3211
+ noExpiration?: boolean;
3212
+ startDate?: string | Date;
3213
+ endDate?: string | Date;
3214
+ status?: "active" | "expired" | "deleted";
3215
+ createdAt?: Date | string;
3216
+ updatedAt?: Date | string;
3217
+ deletedAt?: Date | string;
3218
+ };
3219
+ declare const schemaBulletinBoard: Joi.ObjectSchema<any>;
3220
+ declare const schemaUpdateBulletinBoard: Joi.ObjectSchema<any>;
3221
+ declare function MBulletinBoard(value: TBulletinBoard): {
3222
+ _id: ObjectId;
3223
+ site: string | ObjectId;
3224
+ orgId: string | ObjectId;
3225
+ recipients: ("organization" | "site" | "admin" | "resident" | "service-provider" | "service-provider-member")[];
3226
+ title: string;
3227
+ content: string;
3228
+ file: {
3229
+ _id?: string | ObjectId | undefined;
3230
+ name?: string | undefined;
3231
+ preview?: boolean | undefined;
3232
+ }[];
3233
+ noExpiration: boolean;
3234
+ startDate: string;
3235
+ endDate: string | Date;
3236
+ status: "active" | "deleted" | "expired";
3237
+ createdAt: string | Date;
3238
+ updatedAt: string | Date | undefined;
3239
+ deletedAt: string | Date | undefined;
3240
+ };
3241
+
3242
+ declare function useBulletinBoardRepo(): {
3243
+ add: (value: TBulletinBoard, session?: ClientSession) => Promise<ObjectId>;
3244
+ getAll: ({ search, page, limit, sort, site, status, }: {
3245
+ search?: string | undefined;
3246
+ page?: number | undefined;
3247
+ limit?: number | undefined;
3248
+ sort?: Record<string, any> | undefined;
3249
+ site: string | ObjectId;
3250
+ status: string;
3251
+ }, session?: ClientSession) => Promise<{
3252
+ items: any[];
3253
+ pages: number;
3254
+ pageRange: string;
3255
+ } | TBulletinBoard>;
3256
+ getBulletinBoardById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TBulletinBoard>;
3257
+ updateBulletinBoardById: (_id: ObjectId | string, value: Partial<TBulletinBoard>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3258
+ processExpiredBulletinBoards: (session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3259
+ deleteBulletinBoardById: (_id: string | ObjectId) => Promise<number>;
3260
+ createIndexes: () => Promise<void>;
3261
+ };
3262
+
3263
+ declare function useBulletinBoardService(): {
3264
+ add: (value: TBulletinBoard) => Promise<string>;
3265
+ updateBulletinBoardById: (id: string | ObjectId, value: Partial<TBulletinBoard>) => Promise<string>;
3266
+ processExpiredBulletinBoards: () => Promise<void>;
3267
+ };
3268
+
3269
+ declare function useBulletinBoardController(): {
3270
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3271
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3272
+ getBulletinBoardById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3273
+ updateBulletinBoardById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3274
+ deleteBulletinBoardById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3275
+ };
3276
+
3277
+ type TUnits = {
3278
+ _id?: string | ObjectId;
3279
+ name?: string;
3280
+ };
3281
+ type TBillingItem = {
3282
+ _id?: ObjectId;
3283
+ org: string | ObjectId;
3284
+ site: string | ObjectId;
3285
+ name: string;
3286
+ amount: number;
3287
+ frequency: string;
3288
+ billingType: string;
3289
+ dueInDays?: number;
3290
+ date: string;
3291
+ month?: string;
3292
+ quarter?: string;
3293
+ description?: string;
3294
+ status?: string;
3295
+ taxType?: string;
3296
+ taxPercentage?: number;
3297
+ totalAmount?: number;
3298
+ taxAmount?: number;
3299
+ lastCronGeneratedDate?: string | Date;
3300
+ default: boolean;
3301
+ units?: Array<TUnits>;
3302
+ createdAt?: string | Date;
3303
+ updatedAt?: string | Date;
3304
+ deletedAt?: string | Date;
3305
+ };
3306
+ declare const schemaBillingItem: Joi.ObjectSchema<any>;
3307
+ declare const schemaUpdateSiteBillingItem: Joi.ObjectSchema<any>;
3308
+ declare function MBillingItem(value: TBillingItem): {
3309
+ _id: ObjectId;
3310
+ site: string | ObjectId;
3311
+ org: string | ObjectId;
3312
+ name: string;
3313
+ amount: number;
3314
+ frequency: string;
3315
+ billingType: string;
3316
+ dueInDays: number;
3317
+ date: string;
3318
+ month: string;
3319
+ quarter: string;
3320
+ description: string;
3321
+ status: string;
3322
+ taxType: string;
3323
+ taxPercentage: number;
3324
+ totalAmount: number;
3325
+ taxAmount: number;
3326
+ lastCronGeneratedDate: string | Date;
3327
+ default: boolean;
3328
+ units: TUnits[];
3329
+ createdAt: string | Date;
3330
+ updatedAt: string | Date;
3331
+ deletedAt: string | Date;
3332
+ };
3333
+
3334
+ declare function useSiteBillingItemRepo(): {
3335
+ createTextIndex: () => Promise<string>;
3336
+ add: (value: TBillingItem, session?: ClientSession) => Promise<ObjectId>;
3337
+ getAll: ({ search, page, limit, sort, status, site, }: {
3338
+ search?: string | undefined;
3339
+ page?: number | undefined;
3340
+ limit?: number | undefined;
3341
+ sort?: Record<string, any> | undefined;
3342
+ status: string;
3343
+ site?: string | undefined;
3344
+ }, session?: ClientSession) => Promise<{}>;
3345
+ getById: (_id: string | ObjectId, session?: ClientSession) => Promise<TBillingItem | null>;
3346
+ updateById: (_id: string | ObjectId, value: Partial<TBillingItem>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3347
+ deleteById: (_id: string | ObjectId) => Promise<number>;
3348
+ };
3349
+
3350
+ declare function useSiteBillingItemController(): {
3351
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3352
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3353
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3354
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3355
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3356
+ };
3357
+
3358
+ type TBillingConfiguration = {
3359
+ _id?: ObjectId;
3360
+ org: string | ObjectId;
3361
+ site: string | ObjectId;
3362
+ siteName: string;
3363
+ currencyType: string;
3364
+ taxEnabled: boolean;
3365
+ taxType: string;
3366
+ showBill?: boolean;
3367
+ mcst?: string;
3368
+ address?: string;
3369
+ uenNumber?: string;
3370
+ taxNumber?: string;
3371
+ createdBy?: string | ObjectId;
3372
+ createdByName?: string;
3373
+ taxPercentage: number;
3374
+ bankName?: string;
3375
+ bankBranchCode?: string;
3376
+ bankAccountNumber?: string;
3377
+ bankCode?: string;
3378
+ bankSwiftCode?: string;
3379
+ status?: string;
3380
+ paymentPolicy?: string;
3381
+ createdAt?: string | Date;
3382
+ updatedAt?: string | Date;
3383
+ deletedAt?: string | Date;
3384
+ };
3385
+ declare const schemaBillingConfiguration: Joi.ObjectSchema<any>;
3386
+ declare const schemaUpdateSiteBillingConfiguration: Joi.ObjectSchema<any>;
3387
+ declare function MBillingConfiguration(value: TBillingConfiguration): {
3388
+ _id: ObjectId;
3389
+ site: string | ObjectId;
3390
+ org: string | ObjectId;
3391
+ siteName: string;
3392
+ currencyType: string;
3393
+ taxType: string;
3394
+ taxEnabled: boolean;
3395
+ showBill: boolean;
3396
+ mcst: string;
3397
+ address: string;
3398
+ uenNumber: string;
3399
+ taxNumber: string;
3400
+ createdBy: string | ObjectId;
3401
+ createdByName: string;
3402
+ taxPercentage: number;
3403
+ bankName: string;
3404
+ bankBranchCode: string;
3405
+ bankAccountNumber: string;
3406
+ bankCode: string;
3407
+ bankSwiftCode: string;
3408
+ status: string;
3409
+ paymentPolicy: string;
3410
+ createdAt: string | Date;
3411
+ updatedAt: string | Date;
3412
+ deletedAt: string | Date;
3413
+ };
3414
+
3415
+ declare function useSiteBillingConfigurationRepo(): {
3416
+ createTextIndex: () => Promise<string>;
3417
+ add: (value: TBillingConfiguration, session?: ClientSession) => Promise<ObjectId>;
3418
+ getAll: ({ search, page, limit, sort, status, site, }: {
3419
+ search?: string | undefined;
3420
+ page?: number | undefined;
3421
+ limit?: number | undefined;
3422
+ sort?: Record<string, any> | undefined;
3423
+ status: string;
3424
+ site?: string | undefined;
3425
+ }, session?: ClientSession) => Promise<{}>;
3426
+ getById: (_id: string | ObjectId) => Promise<TBillingConfiguration | null>;
3427
+ updateById: (_id: string | ObjectId, value: Partial<TBillingConfiguration>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3428
+ deleteById: (_id: string | ObjectId) => Promise<number>;
3429
+ };
3430
+
3431
+ declare function useSiteBillingConfigurationController(): {
3432
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3433
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3434
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3435
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3436
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3437
+ };
3438
+
3439
+ type TEventManagement = {
3440
+ _id?: ObjectId;
3441
+ site: ObjectId;
3442
+ title: string;
3443
+ description?: string;
3444
+ dateTime: string | Date;
3445
+ status?: "planned" | "in_progress" | "completed";
3446
+ createdAt?: string | Date;
3447
+ updatedAt?: string | Date;
3448
+ deletedAt?: string | Date;
3449
+ };
3450
+ declare const schemaEventManagement: Joi.ObjectSchema<any>;
3451
+ declare const schemaUpdateEventManagement: Joi.ObjectSchema<any>;
3452
+ declare function MEventManagement(value: TEventManagement): {
3453
+ _id: ObjectId;
3454
+ site: ObjectId;
3455
+ title: string;
3456
+ description: string;
3457
+ dateTime: string | Date;
3458
+ status: "completed" | "planned" | "in_progress";
3459
+ createdAt: string | Date;
3460
+ updatedAt: string | Date | undefined;
3461
+ deletedAt: string | Date | undefined;
3462
+ };
3463
+
3464
+ declare function useEventManagementRepo(): {
3465
+ add: (value: TEventManagement, session?: ClientSession) => Promise<ObjectId>;
3466
+ getAll: ({ search, page, limit, sort, site, status, }: {
3467
+ search?: string | undefined;
3468
+ page?: number | undefined;
3469
+ limit?: number | undefined;
3470
+ sort?: Record<string, any> | undefined;
3471
+ site: string | ObjectId;
3472
+ status: string;
3473
+ }, session?: ClientSession) => Promise<{
3474
+ items: any[];
3475
+ pages: number;
3476
+ pageRange: string;
3477
+ } | TEventManagement>;
3478
+ getEventManagementById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TEventManagement>;
3479
+ updateEventManagementById: (_id: ObjectId | string, value: Partial<TEventManagement>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3480
+ deleteEventManagementById: (_id: string | ObjectId) => Promise<number>;
3481
+ processCompletedEvents: (session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3482
+ createIndexes: () => Promise<void>;
3483
+ createTextIndex: () => Promise<void>;
3484
+ };
3485
+
3486
+ declare function useEventManagementService(): {
3487
+ add: (value: TEventManagement) => Promise<string>;
3488
+ updateEventManagementById: (id: string | ObjectId, value: Partial<TEventManagement>) => Promise<string>;
3489
+ processCompletedEvents: () => Promise<void>;
3490
+ };
3491
+
3492
+ declare function useEventManagementController(): {
3493
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3494
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3495
+ getEventManagementById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3496
+ updateEventManagementById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3497
+ deleteEventManagementById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3498
+ };
3499
+
3500
+ type TUnitBilling = {
3501
+ _id?: ObjectId;
3502
+ site: string | ObjectId;
3503
+ org: string | ObjectId;
3504
+ billItem?: string | ObjectId;
3505
+ billName?: string;
3506
+ unitId?: string | ObjectId;
3507
+ unit?: string;
3508
+ unitOwner?: string;
3509
+ email?: string;
3510
+ contactNumber?: string;
3511
+ category?: string;
3512
+ frequency?: string;
3513
+ totalAmount?: number;
3514
+ taxPercentage?: number;
3515
+ taxAmount?: number;
3516
+ amount?: number;
3517
+ dueDate?: string | Date;
3518
+ issueDate?: string | Date;
3519
+ referenceNumber?: string;
3520
+ paymentStatus?: string;
3521
+ amountPaid?: number;
3522
+ status?: string;
3523
+ paidBy?: string | ObjectId;
3524
+ datePaid?: string | Date;
3525
+ transaction_id?: string;
3526
+ message?: string;
3527
+ method?: string;
3528
+ createdAt?: Date;
3529
+ updatedAt?: string | Date;
3530
+ deletedAt?: string | Date;
3531
+ };
3532
+ declare const schemaUnitBilling: Joi.ObjectSchema<any>;
3533
+ declare const schemaUpdateSiteUnitBilling: Joi.ObjectSchema<any>;
3534
+ declare function MUnitBilling(value: TUnitBilling): {
3535
+ _id: ObjectId;
3536
+ site: string | ObjectId;
3537
+ org: string | ObjectId;
3538
+ billItem: string | ObjectId;
3539
+ billName: string;
3540
+ unitId: string | ObjectId;
3541
+ unit: string;
3542
+ unitOwner: string;
3543
+ email: string;
3544
+ contactNumber: string;
3545
+ category: string;
3546
+ frequency: string;
3547
+ totalAmount: number;
3548
+ taxPercentage: number;
3549
+ taxAmount: number;
3550
+ amount: number;
3551
+ dueDate: string | Date;
3552
+ issueDate: string | Date;
3553
+ referenceNumber: string;
3554
+ paymentStatus: string;
3555
+ status: string;
3556
+ amountPaid: number;
3557
+ paidBy: string | ObjectId;
3558
+ datePaid: string | Date;
3559
+ transaction_id: string;
3560
+ message: string;
3561
+ method: string;
3562
+ createdAt: Date;
3563
+ updatedAt: string | Date;
3564
+ deletedAt: string | Date;
3565
+ };
3566
+
3567
+ declare function useSiteUnitBillingRepo(): {
3568
+ createTextIndex: () => Promise<string>;
3569
+ add: (value: TUnitBilling, session?: ClientSession) => Promise<ObjectId>;
3570
+ getAll: ({ search, page, limit, sort, status, site, paymentStatus, dateFrom, dateTo, }: {
3571
+ search?: string | undefined;
3572
+ page?: number | undefined;
3573
+ limit?: number | undefined;
3574
+ sort?: Record<string, any> | undefined;
3575
+ status: string;
3576
+ site?: string | undefined;
3577
+ paymentStatus?: string | undefined;
3578
+ dateFrom?: string | undefined;
3579
+ dateTo?: string | undefined;
3580
+ }, session?: ClientSession) => Promise<{}>;
3581
+ getById: (_id: string | ObjectId) => Promise<TUnitBilling | null>;
3582
+ updateById: (_id: string | ObjectId, value: Partial<TUnitBilling>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3583
+ deleteById: (_id: string | ObjectId) => Promise<number>;
3584
+ getUnitBillingBySite: ({ status, site, dateFrom, dateTo, unitId, }: {
3585
+ status: string;
3586
+ site?: string | undefined;
3587
+ dateFrom?: string | undefined;
3588
+ dateTo?: string | undefined;
3589
+ unitId: string;
3590
+ }, session?: ClientSession) => Promise<bson.Document[]>;
3591
+ };
3592
+
3593
+ declare function useSiteUnitBillingService(): {
3594
+ processBilling: () => Promise<string>;
3595
+ checkOverDueBills: () => Promise<"No overdue bills found." | "Successfully checked and updated overdue bills.">;
3596
+ };
3597
+
3598
+ declare function useSiteUnitBillingController(): {
3599
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3600
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3601
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3602
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3603
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3604
+ };
3605
+
3606
+ type TAccessManagement = {
3607
+ _id: ObjectId;
3608
+ accessCardType: string;
3609
+ type: string;
3610
+ cardNumber: string;
3611
+ startDate: string | Date;
3612
+ endDate: string | Date;
3613
+ door: string;
3614
+ accessGroup: Array<string>;
3615
+ cardType: string;
3616
+ pinNo: string;
3617
+ useAsLiftCard: boolean;
3618
+ liftAccessLevel: string;
3619
+ isActivate: boolean;
3620
+ isAntiPassBack: boolean;
3621
+ status: string;
3622
+ org?: string | ObjectId;
3623
+ site?: string | ObjectId;
3624
+ unit?: string;
3625
+ assign?: string;
3626
+ createdBy: ObjectId;
3627
+ updatedBy: ObjectId;
3628
+ createdAt: Date;
3629
+ updatedAt: Date;
3630
+ };
3631
+ declare const schemaAccessManagement: Joi.ObjectSchema<any>;
3632
+ declare const schemaUpdateAccessManagement: Joi.ObjectSchema<any>;
3633
+ declare function MAccessManagement(value: TAccessManagement): {
3634
+ _id: ObjectId;
3635
+ accessCardType: string;
3636
+ type: string;
3637
+ cardNumber: string;
3638
+ startDate: string | Date;
3639
+ endDate: string | Date;
3640
+ door: string;
3641
+ accessGroup: string[];
3642
+ cardType: string;
3643
+ pinNo: string;
3644
+ useAsLiftCard: boolean;
3645
+ liftAccessLevel: string;
3646
+ isActivate: boolean;
3647
+ isAntiPassBack: boolean;
3648
+ status: string;
3649
+ org: string | ObjectId | undefined;
3650
+ site: string | ObjectId | undefined;
3651
+ unit: string | undefined;
3652
+ assign: string | undefined;
3653
+ createdBy: ObjectId;
3654
+ updatedBy: ObjectId;
3655
+ createdAt: Date;
3656
+ updatedAt: Date;
3657
+ };
3658
+
3659
+ declare function useAccessManagementRepo(): {
3660
+ createTextIndex: () => Promise<void>;
3661
+ add: (value: TAccessManagement, session?: ClientSession) => Promise<ObjectId>;
3662
+ getAll: ({ search, page, limit, sort, status, org, site, }: {
3663
+ search?: string | undefined;
3664
+ page?: number | undefined;
3665
+ limit?: number | undefined;
3666
+ sort?: Record<string, any> | undefined;
3667
+ status: string;
3668
+ org?: string | undefined;
3669
+ site?: string | undefined;
3670
+ }) => Promise<{
3671
+ items: any[];
3672
+ pages: number;
3673
+ pageRange: string;
3674
+ } | TAccessManagement>;
3675
+ getCardById: (_id: string | ObjectId) => Promise<bson.Document>;
3676
+ updateCardById: (_id: string | ObjectId, value: TAccessManagement) => Promise<number>;
3677
+ deleteCardById: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
3678
+ };
3679
+
3680
+ declare function useAccessManagementController(): {
3681
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3682
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3683
+ getCardById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3684
+ updateCardById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3685
+ deleteCardById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3686
+ };
3687
+
3688
+ declare const DEVICE_STATUS: {
3689
+ readonly CONFIGURED: "Configured";
3690
+ readonly NOT_CONFIGURED: "Not Configured";
3691
+ };
3692
+ type TNfcPatrolTag = {
3693
+ _id?: ObjectId;
3694
+ site: ObjectId;
3695
+ tagID: string;
3696
+ tagUID?: string;
3697
+ name: string;
3698
+ status?: string;
3699
+ createdAt?: string | Date;
3700
+ createdBy?: ObjectId;
3701
+ };
3702
+ type TNfcPatrolTagConfigureReset = {
3703
+ site: string | ObjectId;
3704
+ tagID: string;
3705
+ };
3706
+ type TNfcPatrolTagEdit = {
3707
+ _id: ObjectId;
3708
+ site: string | ObjectId;
3709
+ };
3710
+ type TNfcPatrolTagUpdateData = {
3711
+ _id?: ObjectId;
3712
+ site: string | ObjectId;
3713
+ tagID?: string;
3714
+ tagUID?: string;
3715
+ name?: string;
3716
+ updatedBy?: string | ObjectId;
3717
+ };
3718
+ declare const schemaNfcPatrolTagUpdateData: Joi.ObjectSchema<any>;
3719
+ declare const schemaNfcPatrolTag: Joi.ObjectSchema<any>;
3720
+ declare function MNfcPatrolTag(value: TNfcPatrolTag): {
3721
+ _id: ObjectId;
3722
+ site: ObjectId;
3723
+ tagID: string;
3724
+ name: string;
3725
+ status: string | undefined;
3726
+ createdAt: string | Date;
3727
+ createdBy: ObjectId | undefined;
3728
+ };
3729
+
3730
+ declare function useNfcPatrolTagService(): {
3731
+ add: (value: TNfcPatrolTag) => Promise<string>;
3732
+ updateNfcPatrolTagBySite: (updateType: "Configure" | "Reset" | "Edit", data: TNfcPatrolTagUpdateData) => Promise<string>;
3733
+ };
3734
+
3735
+ declare function useNfcPatrolTagController(): {
3736
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3737
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3738
+ updateNfcPatrolTagBySite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3739
+ };
3740
+
3741
+ declare function useNfcPatrolTagRepo(): {
3742
+ createIndexes: () => Promise<void>;
3743
+ add: (value: TNfcPatrolTag, session?: ClientSession) => Promise<ObjectId>;
3744
+ getAll: ({ page, limit, site, }: {
3745
+ page?: number | undefined;
3746
+ limit?: number | undefined;
3747
+ site: string | ObjectId;
3748
+ }, session?: ClientSession) => Promise<{
3749
+ items: any[];
3750
+ pages: number;
3751
+ pageRange: string;
3752
+ } | TNfcPatrolTag>;
3753
+ updateNfcPatrolTagBySite: (...args: ["Configure", TNfcPatrolTagConfigureReset, {
3754
+ tagUID: string;
3755
+ status: typeof DEVICE_STATUS.CONFIGURED;
3756
+ }, ClientSession?] | ["Reset", TNfcPatrolTagConfigureReset, {
3757
+ status: typeof DEVICE_STATUS.NOT_CONFIGURED;
3758
+ }, ClientSession?] | ["Edit", TNfcPatrolTagEdit, {
3759
+ name: string;
3760
+ tagID: string;
3761
+ updatedBy: string | ObjectId;
3762
+ }, ClientSession?]) => Promise<mongodb.UpdateResult<bson.Document>>;
3763
+ };
3764
+
3765
+ type TOccurrenceBook = {
3766
+ _id?: ObjectId;
3767
+ site: ObjectId;
3768
+ date?: string | Date;
3769
+ totalInput?: number;
3770
+ entryCounter?: number;
3771
+ closedAt?: string | Date;
3772
+ status?: string;
3773
+ createdAt?: string | Date;
3774
+ updatedAt?: string | Date;
3775
+ deletedAt?: string | Date;
3776
+ };
3777
+ declare const schemaOccurrenceBook: Joi.ObjectSchema<any>;
3778
+ declare const schemaUpdateOccurrenceBook: Joi.ObjectSchema<any>;
3779
+ declare function MOccurrenceBook(value: TOccurrenceBook): {
3780
+ _id: ObjectId;
3781
+ site: ObjectId;
3782
+ date: string | Date;
3783
+ totalInput: number;
3784
+ entryCounter: number;
3785
+ closedAt: string | Date;
3786
+ status: string;
3787
+ createdAt: string | Date;
3788
+ updatedAt: string | Date | undefined;
3789
+ deletedAt: string | Date | undefined;
3790
+ };
3791
+
3792
+ declare function useOccurrenceBookRepo(): {
3793
+ add: (value: TOccurrenceBook, session?: ClientSession) => Promise<ObjectId>;
3794
+ getAll: ({ search, page, limit, sort, site, date, status, }: {
3795
+ search?: string | undefined;
3796
+ page?: number | undefined;
3797
+ limit?: number | undefined;
3798
+ sort?: Record<string, any> | undefined;
3799
+ site: string | ObjectId;
3800
+ date?: string | Date | undefined;
3801
+ status: string;
3802
+ }, session?: ClientSession) => Promise<{
3803
+ items: any[];
3804
+ pages: number;
3805
+ pageRange: string;
3806
+ } | TOccurrenceBook>;
3807
+ getOccurrenceBookById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TOccurrenceBook>;
3808
+ updateOccurrenceBookById: (_id: ObjectId | string, value: Partial<TOccurrenceBook>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3809
+ deleteOccurrenceBookById: (_id: string | ObjectId) => Promise<number>;
3810
+ closeOccurrenceBooks: (session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3811
+ createIndexes: () => Promise<void>;
3812
+ createTextIndex: () => Promise<void>;
3813
+ };
3814
+
3815
+ declare function useOccurrenceBookService(): {
3816
+ add: (value: TOccurrenceBook) => Promise<string>;
3817
+ updateOccurrenceBookById: (id: string | ObjectId, value: Partial<TOccurrenceBook>) => Promise<string>;
3818
+ processCreateDOB: () => Promise<void>;
3819
+ processCloseDOB: () => Promise<void>;
3820
+ };
3821
+
3822
+ declare function useOccurrenceBookController(): {
3823
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3824
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3825
+ getOccurrenceBookById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3826
+ updateOccurrenceBookById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3827
+ deleteOccurrenceBookById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3828
+ };
3829
+
3830
+ type TBulletinVideo = {
3831
+ _id?: ObjectId;
3832
+ site: ObjectId;
3833
+ title?: string;
3834
+ description?: string;
3835
+ file?: string | ObjectId;
3836
+ createdAt?: string | Date;
3837
+ updatedAt?: string | Date;
3838
+ deletedAt?: string | Date;
3839
+ };
3840
+ declare const schemaBulletinVideo: Joi.ObjectSchema<any>;
3841
+ declare const schemaUpdateBulletinVideo: Joi.ObjectSchema<any>;
3842
+ declare function MBulletinVideo(value: TBulletinVideo): {
3843
+ _id: ObjectId;
3844
+ site: ObjectId;
3845
+ title: string;
3846
+ description: string;
3847
+ file: string | ObjectId | undefined;
3848
+ createdAt: string | Date;
3849
+ updatedAt: string | Date | undefined;
3850
+ deletedAt: string | Date | undefined;
3851
+ };
3852
+
3853
+ declare function useBulletinVideoRepo(): {
3854
+ add: (value: TBulletinVideo, session?: ClientSession) => Promise<ObjectId>;
3855
+ getAll: ({ search, page, limit, sort, site, }: {
3856
+ search?: string | undefined;
3857
+ page?: number | undefined;
3858
+ limit?: number | undefined;
3859
+ sort?: Record<string, any> | undefined;
3860
+ site: string | ObjectId;
3861
+ }, session?: ClientSession) => Promise<{
3862
+ items: any[];
3863
+ pages: number;
3864
+ pageRange: string;
3865
+ } | TBulletinVideo>;
3866
+ getBulletinVideoById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TBulletinVideo>;
3867
+ updateBulletinVideoById: (_id: ObjectId | string, value: Partial<TBulletinVideo>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3868
+ deleteBulletinVideoById: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
3869
+ createIndexes: () => Promise<void>;
3870
+ };
3871
+
3872
+ declare function useBulletinVideoService(): {
3873
+ add: (value: TBulletinVideo) => Promise<string>;
3874
+ updateBulletinVideoById: (id: string | ObjectId, value: Partial<TBulletinVideo>) => Promise<string>;
3875
+ deleteBulletinVideoById: (id: string | ObjectId) => Promise<string>;
3876
+ };
3877
+
3878
+ declare function useBulletinVideoController(): {
3879
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3880
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3881
+ getBulletinVideoById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3882
+ updateBulletinVideoById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3883
+ deleteBulletinVideoById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3884
+ };
3885
+
3886
+ type TSOABillingItem = Pick<TUnitBilling, "_id" | "billName" | "issueDate" | "dueDate" | "paymentStatus" | "amountPaid" | "referenceNumber" | "totalAmount" | "paidBy" | "datePaid" | "transaction_id" | "method" | "taxPercentage" | "taxAmount" | "amount">;
3887
+ type TSOAStatus = "pending" | "approved" | "rejected" | "deleted";
3888
+ type TStatementOfAccount = {
3889
+ _id?: ObjectId;
3890
+ site: string | ObjectId;
3891
+ unitId?: string | ObjectId;
3892
+ unit?: string;
3893
+ unitOwner?: string;
3894
+ contactNumber?: string;
3895
+ startDate?: string | Date;
3896
+ endDate?: string | Date;
3897
+ billing?: Array<TSOABillingItem>;
3898
+ category?: string;
3899
+ email?: string;
3900
+ status?: TSOAStatus;
3901
+ createdBy: string | ObjectId;
3902
+ createdByName: string;
3903
+ createdAt?: Date;
3904
+ updatedAt?: string | Date;
3905
+ deletedAt?: string | Date;
3906
+ };
3907
+ declare const schemaStatementOfAccount: Joi.ObjectSchema<any>;
3908
+ declare const schemaUpdateStatementOfAccount: Joi.ObjectSchema<any>;
3909
+ declare function MStatementOfAccount(value: TStatementOfAccount): {
3910
+ _id: ObjectId;
3911
+ site: string | ObjectId;
3912
+ unitId: string | ObjectId;
3913
+ unit: string;
3914
+ unitOwner: string;
3915
+ email: string;
3916
+ contactNumber: string;
3917
+ category: string;
3918
+ startDate: string | Date;
3919
+ endDate: string | Date;
3920
+ billing: TSOABillingItem[];
3921
+ status: TSOAStatus;
3922
+ createdBy: string | ObjectId;
3923
+ createdByName: string;
3924
+ createdAt: Date;
3925
+ updatedAt: string | Date;
3926
+ deletedAt: string | Date;
3927
+ };
3928
+
3929
+ declare function useStatementOfAccountRepo(): {
3930
+ createTextIndex: () => Promise<string>;
3931
+ add: (value: TStatementOfAccount, session?: ClientSession) => Promise<ObjectId>;
3932
+ getAll: ({ search, page, limit, sort, status, site, dateFrom, dateTo, }: {
3933
+ search?: string | undefined;
3934
+ page?: number | undefined;
3935
+ limit?: number | undefined;
3936
+ sort?: Record<string, any> | undefined;
3937
+ status: string;
3938
+ site?: string | undefined;
3939
+ dateFrom?: string | undefined;
3940
+ dateTo?: string | undefined;
3941
+ }, session?: ClientSession) => Promise<{}>;
3942
+ getById: (_id: string | ObjectId) => Promise<TStatementOfAccount | null>;
3943
+ updateById: (_id: string | ObjectId, value: Partial<TStatementOfAccount>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3944
+ deleteById: (_id: string | ObjectId) => Promise<number>;
3945
+ updateStatusById: (_id: string | ObjectId, value: Pick<TStatementOfAccount, "status">, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3946
+ };
3947
+
3948
+ declare function useStatementOfAccountController(): {
3949
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3950
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3951
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3952
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3953
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3954
+ generatePDF: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3955
+ updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3956
+ };
3957
+
3958
+ type TEntryPassSettings = {
3959
+ _id?: ObjectId;
3960
+ site: string | ObjectId;
3961
+ org: string | ObjectId;
3962
+ isEnabled: boolean;
3963
+ physicalPass: boolean;
3964
+ nfcPass: boolean;
3965
+ printerVendorId?: string;
3966
+ printerProductId?: string;
3967
+ qrCodeTemplateHeader?: string;
3968
+ qrCodeTemplateHeaderSubText?: string;
3969
+ qrCodeTemplateDate?: string | Date;
3970
+ disclaimerMessage?: string;
3971
+ url?: string;
3972
+ status: string;
3973
+ createdBy: ObjectId;
3974
+ updatedBy: ObjectId;
3975
+ createdAt: Date;
3976
+ updatedAt: Date;
3977
+ deletedAt: Date;
3978
+ };
3979
+ declare const schemaEntryPassSettings: Joi.ObjectSchema<any>;
3980
+ declare const schemaUpdateEntryPassSettings: Joi.ObjectSchema<any>;
3981
+ declare function MEntryPassSettings(value: TEntryPassSettings): {
3982
+ _id: ObjectId | undefined;
3983
+ site: string | ObjectId;
3984
+ org: string | ObjectId;
3985
+ isEnabled: boolean;
3986
+ physicalPass: boolean;
3987
+ nfcPass: boolean;
3988
+ printerVendorId: string | undefined;
3989
+ printerProductId: string | undefined;
3990
+ qrCodeTemplateHeader: string | undefined;
3991
+ qrCodeTemplateHeaderSubText: string | undefined;
3992
+ qrCodeTemplateDate: string | Date | undefined;
3993
+ disclaimerMessage: string | undefined;
3994
+ url: string | undefined;
3995
+ status: string;
3996
+ createdBy: ObjectId;
3997
+ updatedBy: ObjectId;
3998
+ createdAt: Date;
3999
+ updatedAt: Date;
4000
+ deletedAt: Date;
4001
+ };
4002
+
4003
+ declare function useEntryPassSettingsRepo(): {
4004
+ add: (value: TEntryPassSettings, session?: ClientSession) => Promise<ObjectId>;
4005
+ getAll: ({ search, page, limit, sort, status, org, site, }: {
4006
+ search?: string | undefined;
4007
+ page?: number | undefined;
4008
+ limit?: number | undefined;
4009
+ sort?: Record<string, any> | undefined;
4010
+ status: string;
4011
+ org?: string | undefined;
4012
+ site?: string | undefined;
4013
+ }) => Promise<{
4014
+ items: any[];
4015
+ pages: number;
4016
+ pageRange: string;
4017
+ } | TEntryPassSettings>;
4018
+ getEntryPassSettingsById: (_id: string | ObjectId) => Promise<bson.Document>;
4019
+ updateEntryPassSettingsById: (_id: string | ObjectId, value: TEntryPassSettings) => Promise<number>;
4020
+ createTextIndex: () => Promise<void>;
4021
+ deleteEntryPassSettingsById: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
4022
+ getEntryPassSettingsBySiteId: (site: string | ObjectId) => Promise<bson.Document>;
4023
+ updateEntryPassSettingsBySiteId: (site: string | ObjectId, value: TEntryPassSettings) => Promise<number>;
4024
+ };
4025
+
4026
+ declare function useEntryPassSettingsController(): {
4027
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4028
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4029
+ getEntryPassSettingsById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4030
+ updateEntryPassSettingsById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4031
+ deleteEntryPassSettingsById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4032
+ getEntryPassSettingsBySiteId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4033
+ updateEntryPassSettingsBySiteId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4034
+ };
4035
+
4036
+ declare function useDashboardRepo(): {
4037
+ getAll: ({ site, }: {
4038
+ site: string | ObjectId;
4039
+ }, session?: ClientSession) => Promise<{}>;
4040
+ };
4041
+
4042
+ declare function useDashboardController(): {
4043
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4044
+ };
4045
+
4046
+ type TDayNumber = 0 | 1 | 2 | 3 | 4 | 5 | 6;
4047
+ type TCheckPoint$1 = {
4048
+ nfcTag_id: ObjectId | string;
4049
+ travelTime: number;
4050
+ };
4051
+ type TNfcPatrolRoute = {
4052
+ _id?: ObjectId;
4053
+ site: ObjectId;
4054
+ name: string;
4055
+ checkPointNumber: number;
4056
+ tolerance: number;
4057
+ days: TDayNumber[];
4058
+ status?: "Active";
4059
+ startTimes: string[];
4060
+ checkPoints: TCheckPoint$1[];
4061
+ createdAt?: string | Date;
4062
+ createdBy?: string | ObjectId;
4063
+ };
4064
+ type TNfcPatrolRouteEdit = {
4065
+ site: ObjectId;
4066
+ name: string;
4067
+ checkPointNumber: number;
4068
+ tolerance: number;
4069
+ days: TDayNumber[];
4070
+ status?: "Active";
4071
+ startTimes: string[];
4072
+ checkPoints: TCheckPoint$1[];
4073
+ updatedAt?: string | Date;
4074
+ updatedBy?: string | ObjectId;
4075
+ };
4076
+ declare const schemaNfcPatrolRoute: Joi.ObjectSchema<any>;
4077
+ declare function MNfcPatrolRoute(value: TNfcPatrolRoute): {
4078
+ _id: ObjectId;
4079
+ site: ObjectId;
4080
+ name: string;
4081
+ checkPointNumber: number;
4082
+ tolerance: number;
4083
+ days: TDayNumber[];
4084
+ startTimes: string[];
4085
+ checkPoints: TCheckPoint$1[];
4086
+ status: "Active";
4087
+ createdBy: ObjectId;
4088
+ createdAt: string | Date;
4089
+ };
4090
+
4091
+ declare function useNfcPatrolRouteService(): {
4092
+ add: (value: TNfcPatrolRoute) => Promise<string>;
4093
+ updateById: (id: string, data: TNfcPatrolRouteEdit) => Promise<string>;
4094
+ };
4095
+
4096
+ declare function useNfcPatrolRouteController(): {
4097
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4098
+ getAllBySite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4099
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4100
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4101
+ };
4102
+
4103
+ declare function useNfcPatrolRouteRepo(): {
4104
+ createIndexes: () => Promise<void>;
4105
+ add: (value: TNfcPatrolRoute, session?: ClientSession) => Promise<ObjectId>;
4106
+ getAllBySite: ({ page, limit, site, search, filter, }: {
4107
+ page?: number | undefined;
4108
+ limit?: number | undefined;
4109
+ site: string | ObjectId;
4110
+ search: string;
4111
+ filter: string;
4112
+ }, session?: ClientSession) => Promise<{
4113
+ items: any[];
4114
+ pages: number;
4115
+ pageRange: string;
4116
+ } | TNfcPatrolRoute>;
4117
+ getById: (_id: string | ObjectId, isStart?: boolean) => Promise<TNfcPatrolRoute | null>;
4118
+ updateById: (_id: ObjectId | string, value: TNfcPatrolRouteEdit, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
4119
+ };
4120
+
4121
+ type TActionStatus = {
4122
+ actionTaken?: string;
4123
+ status?: string;
4124
+ time?: string;
4125
+ };
4126
+ type TSiteInfo = {
4127
+ site: string | ObjectId;
4128
+ designation?: string;
4129
+ irNumber: string;
4130
+ submittedBy?: string;
4131
+ };
4132
+ type TPlaceOfIncident = {
4133
+ block?: number;
4134
+ level?: string;
4135
+ unit?: ObjectId;
4136
+ other?: string | null;
4137
+ isOther: boolean;
4138
+ };
4139
+ type TIncidentTypeAndTime = {
4140
+ incidentStart?: string;
4141
+ incidentEnd?: string;
4142
+ typeOfIncident: string;
4143
+ dateOfIncident?: string | Date;
4144
+ };
4145
+ type TSubmissionForm = {
4146
+ dateOfReport: string | Date;
4147
+ time?: string;
4148
+ timeOfResponse?: string;
4149
+ dateOfIncident?: string | Date;
4150
+ };
4151
+ type TComplaintInfo = {
4152
+ complainant?: string;
4153
+ contact?: string;
4154
+ nric?: string;
4155
+ };
4156
+ type TRecipientOfComplaint = {
4157
+ contact?: string;
4158
+ recipient?: string;
4159
+ nric?: string;
4160
+ };
4161
+ type TComplaintReceivedTo = {
4162
+ briefDescription: string;
4163
+ otherDescription?: string;
4164
+ receivedVia?: string;
4165
+ };
4166
+ type TIncidentInformation = {
4167
+ siteInfo: TSiteInfo;
4168
+ placeOfIncident: TPlaceOfIncident;
4169
+ incidentTypeAndTime: TIncidentTypeAndTime;
4170
+ submissionForm: TSubmissionForm;
4171
+ complaintInfo?: TComplaintInfo;
4172
+ recipientOfComplaint?: TRecipientOfComplaint;
4173
+ complaintReceivedTo: TComplaintReceivedTo;
4174
+ };
4175
+ type TAffectedEntities = {
4176
+ anyUnitAffectedValue: "yes" | "no";
4177
+ affectedUnit?: Record<string, any> | ObjectId;
4178
+ anyoneAffectedValue: "yes" | "no";
4179
+ affectedInjured: string[];
4180
+ anyPropertyAffectedValue: "yes" | "no";
4181
+ anyoneDamageToProperty: string[];
4182
+ };
4183
+ type TAuthorities = {
4184
+ authoritiesValue: "yes" | "no";
4185
+ authoritiesCalled: string[];
4186
+ incidentThereAfter?: string;
4187
+ managementNotified?: TActionStatus;
4188
+ incidentResolved?: string;
4189
+ causeOfIncident?: string;
4190
+ systemUsed?: string;
4191
+ cctvRecord?: string;
4192
+ particularsOwner?: string;
4193
+ whenIncidentResolve?: TActionStatus;
4194
+ nameOfShiftIncharge?: {
4195
+ personInCharge?: string;
4196
+ actionTaken?: string;
4197
+ shiftStart?: string;
4198
+ shiftEnd?: string;
4199
+ time?: string;
4200
+ };
4201
+ securityImplication?: string;
4202
+ };
4203
+ type TIncidentReport = {
4204
+ _id?: ObjectId;
4205
+ reportId: string;
4206
+ incidentInformation: TIncidentInformation;
4207
+ affectedEntities: TAffectedEntities;
4208
+ authorities: TAuthorities;
4209
+ briefSummary?: string;
4210
+ organization: ObjectId;
4211
+ site: ObjectId;
4212
+ photos?: string[];
4213
+ approvedBy?: ObjectId | null;
4214
+ approvedByName?: string;
4215
+ reasonForReject?: string | null;
4216
+ status: "pending" | "approved" | "rejected";
4217
+ createdAt?: string | Date;
4218
+ updatedAt?: string | Date;
4219
+ deletedAt?: string | Date;
4220
+ };
4221
+
4222
+ declare const schemaIncidentReport: Joi.ObjectSchema<any>;
4223
+ declare const schemaUpdateIncidentReport: Joi.ObjectSchema<any>;
4224
+ declare function MIncidentReport(value: TIncidentReport): {
4225
+ _id: ObjectId;
4226
+ reportId: string;
4227
+ incidentInformation: TIncidentInformation;
4228
+ affectedEntities: TAffectedEntities;
4229
+ authorities: TAuthorities;
4230
+ briefSummary: string;
4231
+ organization: ObjectId;
4232
+ site: ObjectId;
4233
+ photos: string[];
4234
+ approvedBy: ObjectId | null;
4235
+ approvedByName: string;
4236
+ reasonForReject: string | null;
4237
+ status: "pending" | "approved" | "rejected";
4238
+ createdAt: string | Date;
4239
+ updatedAt: string | Date | undefined;
4240
+ deletedAt: string | Date | undefined;
4241
+ };
4242
+
4243
+ declare function useIncidentReportService(): {
4244
+ add: (value: TIncidentReport) => Promise<string>;
4245
+ updateIncidentReportById: (id: string | ObjectId, value: Partial<TIncidentReport>) => Promise<string>;
4246
+ };
4247
+
4248
+ declare function useIncidentReportController(): {
4249
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4250
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4251
+ getIncidentReportById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4252
+ updateIncidentReportById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4253
+ deleteIncidentReportById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4254
+ };
4255
+
4256
+ declare function useIncidentReportRepo(): {
4257
+ add: (value: TIncidentReport, session?: ClientSession) => Promise<ObjectId>;
4258
+ getAll: ({ search, page, limit, sort, site, status, dateFrom, }: {
4259
+ search?: string | undefined;
4260
+ page?: number | undefined;
4261
+ limit?: number | undefined;
4262
+ sort?: Record<string, any> | undefined;
4263
+ site: string | ObjectId;
4264
+ status?: string | undefined;
4265
+ dateFrom?: string | undefined;
4266
+ }, session?: ClientSession) => Promise<{
4267
+ items: any[];
4268
+ pages: number;
4269
+ pageRange: string;
4270
+ } | TIncidentReport>;
4271
+ getIncidentReportById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TIncidentReport>;
4272
+ updateIncidentReportById: (_id: ObjectId | string, value: Partial<TIncidentReport>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
4273
+ deleteIncidentReportById: (_id: string | ObjectId) => Promise<number>;
4274
+ createIndexes: () => Promise<void>;
4275
+ createTextIndex: () => Promise<void>;
4276
+ };
4277
+
4278
+ type TNfcPatrolSettings = {
4279
+ site: string | ObjectId;
4280
+ earlyStartAllowance: number;
4281
+ updatedAt?: Date;
4282
+ updatedBy?: ObjectId;
4283
+ };
4284
+ type TNfcPatrolSettingsUpdate = {
4285
+ earlyStartAllowance: number;
4286
+ updatedAt?: Date;
4287
+ updatedBy?: ObjectId;
4288
+ };
4289
+ type TNfcPatrolSettingsGetBySite = Pick<TNfcPatrolSettings, "earlyStartAllowance" | "updatedBy" | "updatedAt">;
4290
+ declare const nfcPatrolSettingsSchema: Joi.ObjectSchema<any>;
4291
+ declare const nfcPatrolSettingsSchemaUpdate: Joi.ObjectSchema<any>;
4292
+ declare function MNfcPatrolSettings(value: TNfcPatrolSettings): {
4293
+ site: string | ObjectId;
4294
+ earlyStartAllowance: number;
4295
+ updatedAt: Date;
4296
+ updatedBy: ObjectId | undefined;
4297
+ };
4298
+ declare function MNfcPatrolSettingsUpdate(value: TNfcPatrolSettingsUpdate): {
4299
+ earlyStartAllowance: number;
4300
+ updatedAt: Date;
4301
+ updatedBy: ObjectId | undefined;
4302
+ };
4303
+
4304
+ declare function useNfcPatrolSettingsRepository(): {
4305
+ createIndexes: () => Promise<void>;
4306
+ createNfcPatrolSettings: (value: TNfcPatrolSettings, session?: ClientSession) => Promise<ObjectId>;
4307
+ getNfcPatrolSettingsBySite: (site: string | ObjectId, session?: ClientSession) => Promise<TNfcPatrolSettingsGetBySite | null>;
4308
+ updateNfcPatrolSettings: (site: string | ObjectId, value: TNfcPatrolSettingsUpdate, session?: ClientSession) => Promise<number>;
4309
+ };
4310
+
4311
+ declare function useNfcPatrolSettingsService(): {
4312
+ getNfcPatrolSettingsBySite: (site: string | ObjectId) => Promise<TNfcPatrolSettingsGetBySite | null>;
4313
+ updateNfcPatrolSettings: (site: string | ObjectId, value: TNfcPatrolSettingsUpdate) => Promise<string>;
4314
+ };
4315
+
4316
+ declare function useNfcPatrolSettingsController(): {
4317
+ getNfcPatrolSettingsBySite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4318
+ updateNfcPatrolSettings: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4319
+ };
4320
+
4321
+ type TOccurrenceEntry = {
4322
+ _id?: ObjectId;
4323
+ site: ObjectId;
4324
+ dailyOccurrenceBookId?: string | ObjectId;
4325
+ bookEntryCount?: number;
4326
+ serialNumber?: string;
4327
+ date?: string | Date;
4328
+ subject?: string | ObjectId;
4329
+ subjectName?: string;
4330
+ occurrence?: string;
4331
+ incidentReportId?: string | ObjectId;
4332
+ signature?: string | ObjectId;
4333
+ userName?: string;
4334
+ createdAt?: string | Date;
4335
+ updatedAt?: string | Date;
4336
+ deletedAt?: string | Date;
4337
+ };
4338
+ declare const schemaOccurrenceEntry: Joi.ObjectSchema<any>;
4339
+ declare const schemaUpdateOccurrenceEntry: Joi.ObjectSchema<any>;
4340
+ declare function MOccurrenceEntry(value: TOccurrenceEntry): {
4341
+ _id: ObjectId;
4342
+ site: ObjectId;
4343
+ dailyOccurrenceBookId: string | ObjectId | undefined;
4344
+ bookEntryCount: number | undefined;
4345
+ serialNumber: string | undefined;
4346
+ subject: string | ObjectId | undefined;
4347
+ subjectName: string | undefined;
4348
+ occurrence: string | undefined;
4349
+ incidentReportId: string | ObjectId | undefined;
4350
+ signature: string | ObjectId | undefined;
4351
+ userName: string | undefined;
4352
+ date: string | Date | undefined;
4353
+ createdAt: string | Date;
4354
+ updatedAt: string | Date | undefined;
4355
+ deletedAt: string | Date | undefined;
4356
+ };
4357
+
4358
+ declare function useOccurrenceEntryRepo(): {
4359
+ add: (value: TOccurrenceEntry, session?: ClientSession) => Promise<ObjectId>;
4360
+ getAll: ({ search, page, limit, sort, site, dailyOccurrenceBookId, }: {
4361
+ search?: string | undefined;
4362
+ page?: number | undefined;
4363
+ limit?: number | undefined;
4364
+ sort?: Record<string, any> | undefined;
4365
+ site: string | ObjectId;
4366
+ dailyOccurrenceBookId?: string | ObjectId | undefined;
4367
+ }, session?: ClientSession) => Promise<{
4368
+ items: any[];
4369
+ pages: number;
4370
+ pageRange: string;
4371
+ } | TOccurrenceEntry>;
4372
+ getOccurrenceEntryById: (_id: string | ObjectId, session?: ClientSession) => Promise<bson.Document>;
4373
+ getOccurrenceEntryByBookId: (dailyOccurrenceBookId: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TOccurrenceEntry | null>;
4374
+ updateOccurrenceEntryById: (_id: ObjectId | string, value: Partial<TOccurrenceEntry>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
4375
+ updateUserNameBySignatureId: (_id: string | ObjectId, value: string | ObjectId, session?: ClientSession) => Promise<number>;
4376
+ deleteOccurrenceEntryById: (_id: string | ObjectId) => Promise<number>;
4377
+ createIndexes: () => Promise<void>;
4378
+ createTextIndex: () => Promise<void>;
4379
+ getLatestSerialNumber: (dailyOccurrenceBookId: string | ObjectId, session?: ClientSession) => Promise<any>;
4380
+ updateOccurrenceEntryByBookId: (dailyOccurrenceBookId: ObjectId | string, value: Partial<TOccurrenceEntry>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
4381
+ };
4382
+
4383
+ declare function useOccurrenceEntryService(): {
4384
+ add: (value: TOccurrenceEntry) => Promise<string>;
4385
+ updateOccurrenceEntryById: (id: string | ObjectId, value: Partial<TOccurrenceEntry>) => Promise<string>;
4386
+ };
4387
+
4388
+ declare function useOccurrenceEntryController(): {
4389
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4390
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4391
+ getOccurrenceEntryById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4392
+ updateOccurrenceEntryById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4393
+ deleteOccurrenceEntryById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4394
+ getLatestSerialNumber: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4395
+ };
4396
+
4397
+ type TOnlineForm = {
4398
+ _id?: ObjectId;
4399
+ name: string;
4400
+ attachment?: string;
4401
+ inputs?: {
4402
+ label: string;
4403
+ dataType: string;
4404
+ required: boolean;
4405
+ multiple: boolean;
4406
+ }[];
4407
+ status?: string;
4408
+ org?: string | ObjectId;
4409
+ site?: string | ObjectId;
4410
+ createdBy: string | ObjectId;
4411
+ updatedBy?: string | ObjectId;
4412
+ createdAt?: string | Date;
4413
+ updatedAt?: string | Date;
4414
+ deletedAt?: string | Date;
4415
+ };
4416
+ declare const schemaOnlineForm: Joi.ObjectSchema<any>;
4417
+ declare const schemaUpdateOnlineForm: Joi.ObjectSchema<any>;
4418
+ declare function MOnlineForm(value: TOnlineForm): {
4419
+ _id: ObjectId | undefined;
4420
+ name: string;
4421
+ attachment: string | undefined;
4422
+ inputs: {
4423
+ label: string;
4424
+ dataType: string;
4425
+ required: boolean;
4426
+ multiple: boolean;
4427
+ }[] | undefined;
4428
+ status: string | undefined;
4429
+ org: string | ObjectId | undefined;
4430
+ site: string | ObjectId | undefined;
4431
+ createdBy: string | ObjectId;
4432
+ updatedBy: string | ObjectId | undefined;
4433
+ createdAt: string | Date;
4434
+ updatedAt: string | Date;
4435
+ deletedAt: string | Date;
4436
+ };
4437
+
4438
+ declare function useOnlineFormRepo(): {
4439
+ add: (value: TOnlineForm, session?: ClientSession) => Promise<ObjectId>;
4440
+ getAll: ({ search, page, limit, sort, status, org, site, }: {
4441
+ search?: string | undefined;
4442
+ page?: number | undefined;
4443
+ limit?: number | undefined;
4444
+ sort?: Record<string, any> | undefined;
4445
+ status: string;
4446
+ org?: string | undefined;
4447
+ site?: string | undefined;
4448
+ }) => Promise<{
4449
+ items: any[];
4450
+ pages: number;
4451
+ pageRange: string;
4452
+ } | TOnlineForm>;
4453
+ getOnlineFormById: (_id: string | ObjectId) => Promise<bson.Document>;
4454
+ updateOnlineFormById: (_id: string | ObjectId, value: TOnlineForm) => Promise<number>;
4455
+ deleteOnlineFormById: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
4456
+ createTextIndex: () => Promise<void>;
4457
+ getOnlineFormsBySiteId: (site: string | ObjectId, { search, page, limit, status }: {
4458
+ search?: string | undefined;
4459
+ page?: number | undefined;
4460
+ limit?: number | undefined;
4461
+ status?: string | undefined;
4462
+ }) => Promise<{
4463
+ items: any[];
4464
+ pages: number;
4465
+ pageRange: string;
4466
+ } | TOnlineForm>;
4467
+ };
4468
+
4469
+ declare function useOnlineFormController(): {
4470
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4471
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4472
+ getOnlineFormById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4473
+ updateOnlineFormById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4474
+ deleteOnlineFormById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4475
+ getOnlineFormsBySiteId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4476
+ };
4477
+
4478
+ type TOccurrenceSubject = {
4479
+ _id?: ObjectId;
4480
+ site: ObjectId;
4481
+ subject: string;
4482
+ addedBy: string | ObjectId;
4483
+ createdAt?: string | Date;
4484
+ updatedAt?: string | Date;
4485
+ deletedAt?: string | Date;
4486
+ };
4487
+ declare const schemaOccurrenceSubject: Joi.ObjectSchema<any>;
4488
+ declare const schemaUpdateOccurrenceSubject: Joi.ObjectSchema<any>;
4489
+ declare function MOccurrenceSubject(value: TOccurrenceSubject): {
4490
+ _id: ObjectId;
4491
+ site: ObjectId;
4492
+ subject: string;
4493
+ addedBy: string | ObjectId;
4494
+ createdAt: string | Date;
4495
+ updatedAt: string | Date | undefined;
4496
+ deletedAt: string | Date | undefined;
4497
+ };
4498
+
4499
+ declare function useOccurrenceSubjectRepo(): {
4500
+ add: (value: TOccurrenceSubject, session?: ClientSession) => Promise<ObjectId>;
4501
+ getAll: ({ search, page, limit, sort, site, }: {
4502
+ search?: string | undefined;
4503
+ page?: number | undefined;
4504
+ limit?: number | undefined;
4505
+ sort?: Record<string, any> | undefined;
4506
+ site: string | ObjectId;
4507
+ }, session?: ClientSession) => Promise<{
4508
+ items: any[];
4509
+ pages: number;
4510
+ pageRange: string;
4511
+ } | TOccurrenceSubject>;
4512
+ getOccurrenceSubjectById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document> | TOccurrenceSubject>;
4513
+ updateOccurrenceSubjectById: (_id: ObjectId | string, value: Partial<TOccurrenceSubject>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
4514
+ deleteOccurrenceSubjectById: (_id: string | ObjectId) => Promise<number>;
4515
+ createIndexes: () => Promise<void>;
4516
+ createTextIndex: () => Promise<void>;
4517
+ };
4518
+
4519
+ declare function useOccurrenceSubjectService(): {
4520
+ add: (value: TOccurrenceSubject) => Promise<string>;
4521
+ updateOccurrenceSubjectById: (id: string | ObjectId, value: Partial<TOccurrenceSubject>) => Promise<string>;
4522
+ };
4523
+
4524
+ declare function useOccurrenceSubjectController(): {
4525
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4526
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4527
+ getOccurrenceSubjectById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4528
+ updateOccurrenceSubjectById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4529
+ deleteOccurrenceSubjectById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4530
+ };
4531
+
4532
+ type TCheckPoint = {
4533
+ nfcTag_id: ObjectId | string;
4534
+ nfcTag_name: string;
4535
+ travelTime: number;
4536
+ startDateTime: Date;
4537
+ endDateTime: Date;
4538
+ status: string;
4539
+ skippedRemarks?: string;
4540
+ };
4541
+ type TRoute = {
4542
+ _id: ObjectId | string;
4543
+ name: string;
4544
+ startTime: string;
4545
+ };
4546
+ type TNfcPatrolLog = {
4547
+ _id?: ObjectId;
4548
+ site: ObjectId;
4549
+ route: TRoute;
4550
+ date: string;
4551
+ startDateTime: Date;
4552
+ endDateTime: Date;
4553
+ checkPoints: TCheckPoint[];
4554
+ createdAt?: Date;
4555
+ createdBy?: string | ObjectId;
4556
+ };
4557
+ declare const schemaNfcPatrolLog: Joi.ObjectSchema<any>;
4558
+ declare function MNfcPatrolLog(valueArg: TNfcPatrolLog): {
4559
+ _id: any;
4560
+ site: any;
4561
+ route: any;
4562
+ date: any;
4563
+ startDateTime: any;
4564
+ endDateTime: any;
4565
+ checkPoints: any;
4566
+ createdAt: any;
4567
+ createdBy: any;
4568
+ };
4569
+
4570
+ declare function useNfcPatrolLogRepo(): {
4571
+ createIndexes: () => Promise<void>;
4572
+ add: (value: TNfcPatrolLog, session?: ClientSession) => Promise<ObjectId>;
4573
+ getAllBySite: ({ page, limit, site, date, route, }: {
4574
+ page?: number | undefined;
4575
+ limit?: number | undefined;
4576
+ site: string | ObjectId;
4577
+ date?: string | undefined;
4578
+ route?: {
4579
+ _id: ObjectId | string;
4580
+ startTime: string;
4581
+ } | undefined;
4582
+ }, session?: ClientSession) => Promise<{
4583
+ items: any[];
4584
+ pages: number;
4585
+ pageRange: string;
4586
+ } | TNfcPatrolLog>;
4587
+ };
4588
+
4589
+ declare function useNfcPatrolLogService(): {
4590
+ add: (value: TNfcPatrolLog) => Promise<string>;
4591
+ };
4592
+
4593
+ declare function useNfcPatrolLogController(): {
4594
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4595
+ getAllBySite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
4596
+ };
4597
+
4598
+ export { Camera, DEVICE_STATUS, MAccessManagement, MAttendance, MAttendanceSettings, MBillingConfiguration, MBillingItem, MBuilding, MBuildingUnit, MBulletinBoard, MBulletinVideo, MChat, MCustomer, MCustomerSite, MDocumentManagement, MEntryPassSettings, MEventManagement, MFeedback, MFile, MGuestManagement, MIncidentReport, MMember, MNfcPatrolLog, MNfcPatrolRoute, MNfcPatrolSettings, MNfcPatrolSettingsUpdate, MNfcPatrolTag, MOccurrenceBook, MOccurrenceEntry, MOccurrenceSubject, MOnlineForm, MOrg, MPatrolLog, MPatrolQuestion, MPatrolRoute, MPerson, MPromoCode, MRobot, MRole, MServiceProvider, MServiceProviderBilling, MSession, MSite, MSiteCamera, MSiteFacility, MSiteFacilityBooking, MStatementOfAccount, MSubscription, MUnitBilling, MUser, MVehicle, MVehicleTransaction, MVerification, MVisitorTransaction, MWorkOrder, PERSON_TYPES, PersonType, SiteType, TAccessManagement, TActionStatus, TAffectedEntities, TAttendance, TAttendanceCheckIn, TAttendanceCheckOut, TAttendanceCheckTime, TAttendanceLocation, TAttendanceSettings, TAttendanceSettingsGetBySite, TAuthorities, TBilling, TBillingConfiguration, TBillingItem, TBuilding, TBuildingUnit, TBulletinBoard, TBulletinVideo, TCamera, TChat, TCheckPoint$1 as TCheckPoint, TComplaintInfo, TComplaintReceivedTo, TCounter, TCustomer, TCustomerSite, TDayNumber, TDocumentManagement, TEntryPassSettings, TEventManagement, TFeedback, TFeedbackMetadata, TFeedbackUpdate, TFeedbackUpdateCategory, TFeedbackUpdateServiceProvider, TFeedbackUpdateStatus, TFeedbackUpdateToCompleted, TFile, TGetAttendancesByUserQuery, TGetAttendancesQuery, TGuestManagement, TIncidentInformation, TIncidentReport, TIncidentTypeAndTime, TInvoice, TMember, TMemberUpdateStatus, TMiniRole, TNfcPatrolLog, TNfcPatrolRoute, TNfcPatrolRouteEdit, TNfcPatrolSettings, TNfcPatrolSettingsGetBySite, TNfcPatrolSettingsUpdate, TNfcPatrolTag, TNfcPatrolTagConfigureReset, TNfcPatrolTagEdit, TNfcPatrolTagUpdateData, TOccurrenceBook, TOccurrenceEntry, TOccurrenceSubject, TOnlineForm, TOrg, TPatrolLog, TPatrolQuestion, TPatrolRoute, TPerson, TPlaceOfIncident, TPlates, TPrice, TPriceType, TPromoCode, TPromoTier, TRecipientOfComplaint, TRobot, TRobotMetadata, TRole, TRoute, TSOABillingItem, TSOAStatus, TServiceProvider, TServiceProviderBilling, TSession, TSessionCreate, TSite, TSiteCamera, TSiteFacility, TSiteFacilityBooking, TSiteInfo, TSiteMetadata, TSiteUpdateBlock, TStatementOfAccount, TSubmissionForm, TSubscription, TUnitBilling, TUnits, TUpdateName, TUser, TUserCreate, TVehicle, TVehicleTransaction, TVehicleUpdate, TVerification, TVerificationMetadata, TVisitorTransaction, TWorkOrder, TWorkOrderMetadata, TWorkOrderUpdate, TWorkOrderUpdateStatus, TWorkOrderUpdateToCompleted, allowedCategories, allowedFieldsSite, allowedNatures, allowedTypes, attendanceSchema, attendanceSettingsSchema, chatSchema, customerSchema, feedbackSchema, logCamera, nfcPatrolSettingsSchema, nfcPatrolSettingsSchemaUpdate, orgSchema, promoCodeSchema, robotSchema, schema, schemaAccessManagement, schemaBilling, schemaBillingConfiguration, schemaBillingItem, schemaBuilding, schemaBuildingUnit, schemaBuildingUpdateOptions, schemaBulletinBoard, schemaBulletinVideo, schemaCustomerSite, schemaDocumentManagement, schemaEntryPassSettings, schemaEventManagement, schemaGuestManagement, schemaIncidentReport, schemaNfcPatrolLog, schemaNfcPatrolRoute, schemaNfcPatrolTag, schemaNfcPatrolTagUpdateData, schemaOccurrenceBook, schemaOccurrenceEntry, schemaOccurrenceSubject, schemaOnlineForm, schemaPatrolLog, schemaPatrolQuestion, schemaPatrolRoute, schemaPerson, schemaPlate, schemaServiceProvider, schemaServiceProviderBilling, schemaSiteCamera, schemaSiteFacility, schemaSiteFacilityBooking, schemaStatementOfAccount, schemaUnitBilling, schemaUpdateAccessManagement, schemaUpdateBulletinBoard, schemaUpdateBulletinVideo, schemaUpdateDocumentManagement, schemaUpdateEntryPassSettings, schemaUpdateEventManagement, schemaUpdateGuestManagement, schemaUpdateIncidentReport, schemaUpdateOccurrenceBook, schemaUpdateOccurrenceEntry, schemaUpdateOccurrenceSubject, schemaUpdateOnlineForm, schemaUpdateOptions, schemaUpdatePatrolLog, schemaUpdatePatrolQuestion, schemaUpdatePatrolRoute, schemaUpdatePerson, schemaUpdateServiceProviderBilling, schemaUpdateSiteBillingConfiguration, schemaUpdateSiteBillingItem, schemaUpdateSiteCamera, schemaUpdateSiteFacility, schemaUpdateSiteUnitBilling, schemaUpdateStatementOfAccount, schemaUpdateVisTrans, schemaVehicleTransaction, schemaVisitorTransaction, schemeCamera, schemeLogCamera, siteSchema, tokenSchema, useAccessManagementController, useAccessManagementRepo, useAttendanceController, useAttendanceRepository, useAttendanceSettingsController, useAttendanceSettingsRepository, useAttendanceSettingsService, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useBulletinBoardController, useBulletinBoardRepo, useBulletinBoardService, useBulletinVideoController, useBulletinVideoRepo, useBulletinVideoService, useChatController, useChatRepo, useCounterModel, useCounterRepo, useCustomerController, useCustomerRepo, useCustomerSiteController, useCustomerSiteRepo, useCustomerSiteService, useDahuaService, useDashboardController, useDashboardRepo, useDocumentManagementController, useDocumentManagementRepo, useDocumentManagementService, useEntryPassSettingsController, useEntryPassSettingsRepo, useEventManagementController, useEventManagementRepo, useEventManagementService, useFeedbackController, useFeedbackRepo, useFeedbackService, useFileController, useFileRepo, useFileService, useGuestManagementController, useGuestManagementRepo, useGuestManagementService, useIncidentReportController, useIncidentReportRepo, useIncidentReportService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useMemberController, useMemberRepo, useNfcPatrolLogController, useNfcPatrolLogRepo, useNfcPatrolLogService, useNfcPatrolRouteController, useNfcPatrolRouteRepo, useNfcPatrolRouteService, useNfcPatrolSettingsController, useNfcPatrolSettingsRepository, useNfcPatrolSettingsService, useNfcPatrolTagController, useNfcPatrolTagRepo, useNfcPatrolTagService, useOccurrenceBookController, useOccurrenceBookRepo, useOccurrenceBookService, useOccurrenceEntryController, useOccurrenceEntryRepo, useOccurrenceEntryService, useOccurrenceSubjectController, useOccurrenceSubjectRepo, useOccurrenceSubjectService, useOnlineFormController, useOnlineFormRepo, useOrgController, useOrgRepo, usePatrolLogController, usePatrolLogRepo, usePatrolQuestionController, usePatrolQuestionRepo, usePatrolRouteController, usePatrolRouteRepo, usePersonController, usePersonRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRobotController, useRobotRepo, useRobotService, useRoleController, useRoleRepo, useServiceProviderBillingController, useServiceProviderBillingRepo, useServiceProviderBillingService, useServiceProviderController, useServiceProviderRepo, useSessionRepo, useSiteBillingConfigurationController, useSiteBillingConfigurationRepo, useSiteBillingItemController, useSiteBillingItemRepo, useSiteCameraController, useSiteCameraRepo, useSiteCameraService, useSiteController, useSiteFacilityBookingController, useSiteFacilityBookingRepo, useSiteFacilityBookingService, useSiteFacilityController, useSiteFacilityRepo, useSiteFacilityService, useSiteRepo, useSiteService, useSiteUnitBillingController, useSiteUnitBillingRepo, useSiteUnitBillingService, useStatementOfAccountController, useStatementOfAccountRepo, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useUserController, useUserRepo, useUserService, useVehicleController, useVehicleRepo, useVehicleService, useVerificationController, useVerificationRepo, useVerificationService, useVisitorTransactionController, useVisitorTransactionRepo, useVisitorTransactionService, useWorkOrderController, useWorkOrderRepo, useWorkOrderService, userSchema, vehicleSchema, workOrderSchema };