@iservice365/module-hygiene 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +193 -21
- package/dist/index.js +2183 -284
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2245 -332
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ObjectId, ClientSession } from 'mongodb';
|
|
|
4
4
|
import * as bson from 'bson';
|
|
5
5
|
import { Request, Response, NextFunction } from 'express';
|
|
6
6
|
|
|
7
|
-
interface
|
|
7
|
+
interface TManageAreaChecklist {
|
|
8
8
|
_id: string | ObjectId;
|
|
9
9
|
name: string;
|
|
10
10
|
}
|
|
@@ -13,7 +13,7 @@ type TArea = {
|
|
|
13
13
|
name: string;
|
|
14
14
|
site?: string | ObjectId;
|
|
15
15
|
createdBy?: string | ObjectId;
|
|
16
|
-
checklist?:
|
|
16
|
+
checklist?: TManageAreaChecklist[];
|
|
17
17
|
status?: string;
|
|
18
18
|
createdAt?: Date | string;
|
|
19
19
|
updatedAt?: Date | string;
|
|
@@ -26,7 +26,7 @@ declare function MArea(value: TArea): {
|
|
|
26
26
|
name: string;
|
|
27
27
|
site: string | ObjectId | undefined;
|
|
28
28
|
createdBy: string | ObjectId | undefined;
|
|
29
|
-
checklist:
|
|
29
|
+
checklist: TManageAreaChecklist[] | undefined;
|
|
30
30
|
status: string;
|
|
31
31
|
createdAt: Date;
|
|
32
32
|
updatedAt: string | Date;
|
|
@@ -159,11 +159,13 @@ declare function useToiletLocationController(): {
|
|
|
159
159
|
uploadByFile: (req: MulterRequest, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
+
declare const allowedTypes: string[];
|
|
163
|
+
declare const allowedStatus: string[];
|
|
162
164
|
interface TParentChecklistStatus {
|
|
165
|
+
type: (typeof allowedTypes)[number];
|
|
163
166
|
site: string | ObjectId;
|
|
164
|
-
status:
|
|
167
|
+
status: (typeof allowedStatus)[number];
|
|
165
168
|
completedAt: string | Date;
|
|
166
|
-
type: string;
|
|
167
169
|
}
|
|
168
170
|
type TParentChecklist = {
|
|
169
171
|
_id?: ObjectId;
|
|
@@ -179,26 +181,26 @@ declare function MParentChecklist(value: TParentChecklist): {
|
|
|
179
181
|
status: TParentChecklistStatus[] | undefined;
|
|
180
182
|
createdAt: Date;
|
|
181
183
|
updatedAt: string | Date;
|
|
182
|
-
deletedAt: string | Date;
|
|
183
184
|
};
|
|
184
185
|
|
|
185
186
|
declare function useParentChecklistRepo(): {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
createIndex: () => Promise<void>;
|
|
188
|
+
createParentChecklist: (value: TParentChecklist, session?: ClientSession) => Promise<ObjectId>;
|
|
189
|
+
getAllParentChecklist: ({ page, limit, search, site, type, startDate, endDate, }: {
|
|
189
190
|
page?: number | undefined;
|
|
190
191
|
limit?: number | undefined;
|
|
191
192
|
search?: string | undefined;
|
|
192
|
-
|
|
193
|
+
site: ObjectId | string;
|
|
194
|
+
type: (typeof allowedTypes)[number];
|
|
193
195
|
startDate?: string | Date | undefined;
|
|
194
196
|
endDate?: string | Date | undefined;
|
|
195
|
-
site?: string | ObjectId | undefined;
|
|
196
197
|
}) => Promise<{}>;
|
|
198
|
+
updateParentChecklistStatuses: (date?: Date) => Promise<mongodb.BulkWriteResult | null>;
|
|
197
199
|
};
|
|
198
200
|
|
|
199
|
-
declare function
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
declare function useParentChecklistController(): {
|
|
202
|
+
createParentChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
203
|
+
getAllParentChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
202
204
|
};
|
|
203
205
|
|
|
204
206
|
interface TUnit {
|
|
@@ -298,14 +300,14 @@ declare function MScheduleTaskArea(value: TScheduleTaskArea): {
|
|
|
298
300
|
};
|
|
299
301
|
|
|
300
302
|
declare function useScheduleTaskAreaRepository(): {
|
|
303
|
+
createUniqueIndex: () => Promise<void>;
|
|
301
304
|
createScheduleTaskArea: (value: TScheduleTaskArea, session?: ClientSession) => Promise<ObjectId>;
|
|
302
305
|
updateScheduleTaskArea: (_id: string | ObjectId, params: TScheduleTaskArea) => Promise<number>;
|
|
303
306
|
deleteScheduleTaskArea: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
|
|
304
|
-
getScheduleTaskAreas: ({ page, limit, search,
|
|
307
|
+
getScheduleTaskAreas: ({ page, limit, search, startDate, endDate, site, }: {
|
|
305
308
|
page?: number | undefined;
|
|
306
309
|
limit?: number | undefined;
|
|
307
310
|
search?: string | undefined;
|
|
308
|
-
sort?: Record<string, any> | undefined;
|
|
309
311
|
startDate?: string | Date | undefined;
|
|
310
312
|
endDate?: string | Date | undefined;
|
|
311
313
|
site?: string | ObjectId | undefined;
|
|
@@ -313,20 +315,190 @@ declare function useScheduleTaskAreaRepository(): {
|
|
|
313
315
|
createIndexes: () => Promise<void>;
|
|
314
316
|
getScheduleTaskAreaByName: (name: string, site?: string | ObjectId) => Promise<mongodb.WithId<bson.Document> | null>;
|
|
315
317
|
getScheduleTaskAreaById: (id: string | ObjectId, site?: string | ObjectId) => Promise<mongodb.WithId<bson.Document> | null>;
|
|
318
|
+
getAreaById: (_id: string | ObjectId) => Promise<{}>;
|
|
316
319
|
};
|
|
317
320
|
|
|
318
321
|
declare function useScheduleTaskAreaService(): {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
322
|
+
uploadByFile: ({ dataJson, createdBy, site, }: {
|
|
323
|
+
dataJson: string;
|
|
324
|
+
createdBy: string | ObjectId;
|
|
325
|
+
site: string | ObjectId;
|
|
326
|
+
}) => Promise<{
|
|
327
|
+
message: string;
|
|
328
|
+
}>;
|
|
323
329
|
};
|
|
324
330
|
|
|
325
331
|
declare function useScheduleTaskAreaController(): {
|
|
326
332
|
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
333
|
+
getAreaById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
327
334
|
createScheduleTaskArea: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
328
335
|
updateScheduleTaskArea: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
329
336
|
deleteScheduleTaskArea: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
337
|
+
uploadByFile: (req: MulterRequest, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
type TAreaChecklist = {
|
|
341
|
+
_id?: ObjectId;
|
|
342
|
+
type: (typeof allowedTypes)[number];
|
|
343
|
+
site: string | ObjectId;
|
|
344
|
+
parentChecklist: string | ObjectId;
|
|
345
|
+
area: string | ObjectId;
|
|
346
|
+
name?: string;
|
|
347
|
+
metadata?: TAreaChecklistMetadata;
|
|
348
|
+
status?: (typeof allowedStatus)[number];
|
|
349
|
+
createdBy?: string | ObjectId;
|
|
350
|
+
createdAt?: Date | string;
|
|
351
|
+
acceptedBy?: string | ObjectId;
|
|
352
|
+
acceptedAt?: Date | string;
|
|
353
|
+
startedAt?: Date | string;
|
|
354
|
+
endedAt?: Date | string;
|
|
355
|
+
signature?: string;
|
|
356
|
+
updatedAt?: Date | string;
|
|
357
|
+
};
|
|
358
|
+
type TAreaChecklistMetadata = {
|
|
359
|
+
attachments?: string[];
|
|
360
|
+
};
|
|
361
|
+
type TAreaChecklistCreate = Pick<TAreaChecklist, "type" | "site" | "parentChecklist" | "createdBy"> & {
|
|
362
|
+
areas: Array<{
|
|
363
|
+
area: string | ObjectId;
|
|
364
|
+
name?: string;
|
|
365
|
+
}>;
|
|
366
|
+
};
|
|
367
|
+
declare const areaChecklistSchema: Joi.ObjectSchema<any>;
|
|
368
|
+
declare function MAreaChecklist(value: TAreaChecklist): {
|
|
369
|
+
type: string;
|
|
370
|
+
site: string | ObjectId;
|
|
371
|
+
parentChecklist: string | ObjectId;
|
|
372
|
+
area: string | ObjectId;
|
|
373
|
+
name: string;
|
|
374
|
+
status: string;
|
|
375
|
+
createdBy: string | ObjectId;
|
|
376
|
+
createdAt: Date;
|
|
377
|
+
acceptedBy: string | ObjectId;
|
|
378
|
+
acceptedAt: string | Date;
|
|
379
|
+
startedAt: string | Date;
|
|
380
|
+
endedAt: string | Date;
|
|
381
|
+
signature: string;
|
|
382
|
+
updatedAt: string | Date;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
declare function useAreaChecklistRepo(): {
|
|
386
|
+
createIndex: () => Promise<void>;
|
|
387
|
+
createTextIndex: () => Promise<void>;
|
|
388
|
+
createAreaChecklist: (value: TAreaChecklist, session?: ClientSession) => Promise<ObjectId>;
|
|
389
|
+
getAllAreaChecklist: ({ page, limit, search, site, type, parentChecklist, }: {
|
|
390
|
+
page?: number | undefined;
|
|
391
|
+
limit?: number | undefined;
|
|
392
|
+
search?: string | undefined;
|
|
393
|
+
site: string | ObjectId;
|
|
394
|
+
type: (typeof allowedTypes)[number];
|
|
395
|
+
parentChecklist: string | ObjectId;
|
|
396
|
+
}) => Promise<{}>;
|
|
397
|
+
getAreaChecklistHistory: ({ page, limit, search, site, type, parentChecklist, status, createdAt, user, }: {
|
|
398
|
+
page?: number | undefined;
|
|
399
|
+
limit?: number | undefined;
|
|
400
|
+
search?: string | undefined;
|
|
401
|
+
site: string | ObjectId;
|
|
402
|
+
type: (typeof allowedTypes)[number];
|
|
403
|
+
parentChecklist: string | ObjectId;
|
|
404
|
+
status?: string | undefined;
|
|
405
|
+
createdAt?: string | Date | undefined;
|
|
406
|
+
user?: string | ObjectId | undefined;
|
|
407
|
+
}) => Promise<{}>;
|
|
408
|
+
getAreaChecklistHistoryDetails: (_id: string | ObjectId) => Promise<{}>;
|
|
409
|
+
acceptAreaChecklist: (_id: string | ObjectId, acceptedBy: string | ObjectId) => Promise<number>;
|
|
410
|
+
attachImageAreaChecklist: (_id: string | ObjectId, attachments: string[], session?: ClientSession) => Promise<number>;
|
|
411
|
+
submitAreaChecklist: (_id: string | ObjectId, signature: string) => Promise<number>;
|
|
412
|
+
completeAreaChecklist: (_id: string | ObjectId, signature: string) => Promise<number>;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
declare function useAreaChecklistController(): {
|
|
416
|
+
createAreaChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
417
|
+
getAllAreaChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
418
|
+
getAreaChecklistHistory: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
419
|
+
getAreaChecklistHistoryDetails: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
420
|
+
acceptAreaChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
421
|
+
attachImageAreaChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
422
|
+
submitAreaChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
423
|
+
completeAreaChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
type TUnitChecklistMetadataWorkOrder = {
|
|
427
|
+
attachments?: Array<string>;
|
|
428
|
+
subject: string;
|
|
429
|
+
category: string | ObjectId;
|
|
430
|
+
highPriority?: boolean;
|
|
431
|
+
block?: string;
|
|
432
|
+
level?: string;
|
|
433
|
+
unit?: string;
|
|
434
|
+
location?: string;
|
|
435
|
+
description: string;
|
|
436
|
+
createdBy: string | ObjectId;
|
|
437
|
+
createdByName?: string;
|
|
438
|
+
serviceProvider?: string | ObjectId;
|
|
439
|
+
organization?: string | ObjectId;
|
|
440
|
+
site?: string | ObjectId;
|
|
441
|
+
};
|
|
442
|
+
type TUnitChecklistMetadata = {
|
|
443
|
+
attachments?: string[];
|
|
444
|
+
remarks?: string;
|
|
445
|
+
workOrder?: TUnitChecklistMetadataWorkOrder;
|
|
446
|
+
};
|
|
447
|
+
type TUnitChecklist = {
|
|
448
|
+
_id?: ObjectId;
|
|
449
|
+
site: string | ObjectId;
|
|
450
|
+
type: (typeof allowedTypes)[number];
|
|
451
|
+
parentChecklist: string | ObjectId;
|
|
452
|
+
areaChecklist: string | ObjectId;
|
|
453
|
+
unit: ObjectId;
|
|
454
|
+
name?: string;
|
|
455
|
+
approve?: boolean;
|
|
456
|
+
reject?: boolean;
|
|
457
|
+
checkedBy?: string | ObjectId;
|
|
458
|
+
metadata?: TUnitChecklistMetadata;
|
|
459
|
+
createdBy?: string | ObjectId;
|
|
460
|
+
createdAt?: Date | string;
|
|
461
|
+
updatedAt?: Date | string;
|
|
462
|
+
};
|
|
463
|
+
type TUnitChecklistApprove = Partial<Pick<TUnitChecklist, "approve" | "reject" | "checkedBy">>;
|
|
464
|
+
type TUnitChecklistReject = Partial<Pick<TUnitChecklist, "approve" | "reject" | "checkedBy" | "metadata">>;
|
|
465
|
+
declare const unitChecklistSchema: Joi.ObjectSchema<any>;
|
|
466
|
+
declare function MUnitChecklist(value: TUnitChecklist): {
|
|
467
|
+
site: string | ObjectId;
|
|
468
|
+
type: string;
|
|
469
|
+
parentChecklist: string | ObjectId;
|
|
470
|
+
areaChecklist: string | ObjectId;
|
|
471
|
+
unit: ObjectId;
|
|
472
|
+
name: string;
|
|
473
|
+
approve: boolean;
|
|
474
|
+
reject: boolean;
|
|
475
|
+
createdBy: string | ObjectId;
|
|
476
|
+
createdAt: Date;
|
|
477
|
+
updatedAt: string | Date;
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
declare function useUnitChecklistRepo(): {
|
|
481
|
+
createIndex: () => Promise<void>;
|
|
482
|
+
createTextIndex: () => Promise<void>;
|
|
483
|
+
createUnitChecklist: (value: TUnitChecklist, session?: ClientSession) => Promise<ObjectId>;
|
|
484
|
+
getAllUnitChecklist: ({ page, limit, search, site, type, parentChecklist, areaChecklist, }: {
|
|
485
|
+
page?: number | undefined;
|
|
486
|
+
limit?: number | undefined;
|
|
487
|
+
search?: string | undefined;
|
|
488
|
+
site: string | ObjectId;
|
|
489
|
+
type: (typeof allowedTypes)[number];
|
|
490
|
+
parentChecklist: string | ObjectId;
|
|
491
|
+
areaChecklist: string | ObjectId;
|
|
492
|
+
}) => Promise<{}>;
|
|
493
|
+
getUnitChecklistById: (_id: string | ObjectId) => Promise<mongodb.WithId<bson.Document> | null>;
|
|
494
|
+
updateUnitChecklist: (_id: string | ObjectId, value: TUnitChecklistApprove | TUnitChecklistReject, session?: ClientSession) => Promise<number>;
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
declare function useUnitChecklistController(): {
|
|
498
|
+
createUnitChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
499
|
+
getAllUnitChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
500
|
+
approveUnitChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
501
|
+
rejectUnitChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
330
502
|
};
|
|
331
503
|
|
|
332
|
-
export { MArea, MParentChecklist, MScheduleTaskArea, MToiletLocation, MUnit, TArea, TAreaChecklist, TAreaUpdate, TAreaUpdateChecklist, TGetScheduleTaskAreasQuery, TGetToiletLocationsQuery, TGetUnitsQuery, TParentChecklist, TParentChecklistStatus, TScheduleTaskArea, TScheduleTaskAreaCheckList, TToiletLocation, TToiletLocationChecklist, TToiletUpdateChecklist, TUnit, TUnitUpdate, areaSchema, parentChecklistSchema, scheduleTaskAreaSchema, toiletLocationSchema, unitSchema, useAreaController, useAreaRepository, useAreaService,
|
|
504
|
+
export { MArea, MAreaChecklist, MParentChecklist, MScheduleTaskArea, MToiletLocation, MUnit, MUnitChecklist, TArea, TAreaChecklist, TAreaChecklistCreate, TAreaChecklistMetadata, TAreaUpdate, TAreaUpdateChecklist, TGetScheduleTaskAreasQuery, TGetToiletLocationsQuery, TGetUnitsQuery, TManageAreaChecklist, TParentChecklist, TParentChecklistStatus, TScheduleTaskArea, TScheduleTaskAreaCheckList, TToiletLocation, TToiletLocationChecklist, TToiletUpdateChecklist, TUnit, TUnitChecklist, TUnitChecklistApprove, TUnitChecklistMetadata, TUnitChecklistMetadataWorkOrder, TUnitChecklistReject, TUnitUpdate, allowedStatus, allowedTypes, areaChecklistSchema, areaSchema, parentChecklistSchema, scheduleTaskAreaSchema, toiletLocationSchema, unitChecklistSchema, unitSchema, useAreaChecklistController, useAreaChecklistRepo, useAreaController, useAreaRepository, useAreaService, useParentChecklistController, useParentChecklistRepo, useScheduleTaskAreaController, useScheduleTaskAreaRepository, useScheduleTaskAreaService, useToiletLocationController, useToiletLocationRepository, useToiletLocationService, useUnitChecklistController, useUnitChecklistRepo, useUnitController, useUnitRepository, useUnitService };
|