@7365admin1/module-hygiene 4.14.0 → 4.16.0
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 +12 -0
- package/dist/index.d.ts +41 -31
- package/dist/index.js +145 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +145 -46
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -135,19 +135,19 @@ type TUnit = {
|
|
|
135
135
|
status?: "active" | "deleted";
|
|
136
136
|
};
|
|
137
137
|
type TUnitCreate = {
|
|
138
|
-
serviceType
|
|
138
|
+
serviceType: TServiceType;
|
|
139
139
|
} & Pick<TUnit, "site" | "name">;
|
|
140
140
|
type TUnitGetQuery = {
|
|
141
141
|
page?: number;
|
|
142
142
|
limit?: number;
|
|
143
143
|
search?: string;
|
|
144
|
-
serviceType
|
|
144
|
+
serviceType: TServiceType;
|
|
145
145
|
} & Pick<TUnit, "site">;
|
|
146
146
|
type TUnitUpdate = Pick<TUnit, "name">;
|
|
147
147
|
declare const unitSchema: Joi.ObjectSchema<any>;
|
|
148
148
|
declare function MUnit(value: TUnitCreate): {
|
|
149
149
|
site: string | ObjectId;
|
|
150
|
-
serviceType: ServiceType
|
|
150
|
+
serviceType: ServiceType;
|
|
151
151
|
name: string;
|
|
152
152
|
status: string;
|
|
153
153
|
createdAt: Date;
|
|
@@ -159,7 +159,7 @@ declare function useUnitService(): {
|
|
|
159
159
|
importUnit: ({ dataJson, site, serviceType, }: {
|
|
160
160
|
dataJson: string;
|
|
161
161
|
site: string | ObjectId;
|
|
162
|
-
serviceType
|
|
162
|
+
serviceType: TServiceType;
|
|
163
163
|
}) => Promise<{
|
|
164
164
|
message: string;
|
|
165
165
|
}>;
|
|
@@ -167,7 +167,7 @@ declare function useUnitService(): {
|
|
|
167
167
|
deleteUnit: (_id: string | ObjectId) => Promise<number>;
|
|
168
168
|
exportUnits: ({ site, serviceType, }: {
|
|
169
169
|
site: string | ObjectId;
|
|
170
|
-
serviceType
|
|
170
|
+
serviceType: TServiceType;
|
|
171
171
|
}) => Promise<Buffer>;
|
|
172
172
|
};
|
|
173
173
|
|
|
@@ -192,12 +192,16 @@ declare function useUnitController(): {
|
|
|
192
192
|
|
|
193
193
|
type TParentChecklist = {
|
|
194
194
|
_id?: ObjectId;
|
|
195
|
-
site
|
|
196
|
-
serviceType
|
|
195
|
+
site: string | ObjectId;
|
|
196
|
+
serviceType: TServiceType;
|
|
197
197
|
status?: (typeof allowedStatus)[number];
|
|
198
198
|
createdAt?: Date | string;
|
|
199
199
|
updatedAt?: Date | string;
|
|
200
200
|
};
|
|
201
|
+
type TParentChecklistCreate = {
|
|
202
|
+
site?: string | ObjectId;
|
|
203
|
+
serviceType?: TServiceType;
|
|
204
|
+
} & Pick<TParentChecklist, "createdAt">;
|
|
201
205
|
type TParentChecklistGetQuery = {
|
|
202
206
|
site: string | ObjectId;
|
|
203
207
|
serviceType: TServiceType;
|
|
@@ -209,8 +213,8 @@ type TParentChecklistGetQuery = {
|
|
|
209
213
|
} & Pick<TParentChecklist, "status">;
|
|
210
214
|
declare const parentChecklistSchema: Joi.ObjectSchema<any>;
|
|
211
215
|
declare function MParentChecklist(value: TParentChecklist): {
|
|
212
|
-
site: string | ObjectId
|
|
213
|
-
serviceType: ServiceType
|
|
216
|
+
site: string | ObjectId;
|
|
217
|
+
serviceType: ServiceType;
|
|
214
218
|
status: string;
|
|
215
219
|
createdAt: string | Date;
|
|
216
220
|
updatedAt: string | Date;
|
|
@@ -218,12 +222,13 @@ declare function MParentChecklist(value: TParentChecklist): {
|
|
|
218
222
|
|
|
219
223
|
declare function useParentChecklistRepo(): {
|
|
220
224
|
createIndex: () => Promise<void>;
|
|
221
|
-
createParentChecklist: (value:
|
|
225
|
+
createParentChecklist: (value: TParentChecklistCreate, session?: ClientSession) => Promise<ObjectId | ObjectId[]>;
|
|
222
226
|
getAllParentChecklist: ({ page, limit, search, site, startDate, endDate, status, serviceType, }: TParentChecklistGetQuery) => Promise<{}>;
|
|
223
227
|
getParentChecklistById: (_id: string | ObjectId) => Promise<TParentChecklist & {
|
|
224
228
|
_id: ObjectId;
|
|
225
229
|
}>;
|
|
226
230
|
updateParentChecklistStatuses: (_id: string | ObjectId, status: (typeof allowedStatus)[number], session?: ClientSession) => Promise<number>;
|
|
231
|
+
getHygieneSiteIds: () => Promise<any[]>;
|
|
227
232
|
closeExpiredParentChecklists: () => Promise<number>;
|
|
228
233
|
getTodayParentChecklists: () => Promise<{
|
|
229
234
|
_id: ObjectId;
|
|
@@ -274,9 +279,7 @@ type TAreaChecklistUnits = {
|
|
|
274
279
|
completedBy?: string | ObjectId;
|
|
275
280
|
timestamp?: Date | string;
|
|
276
281
|
};
|
|
277
|
-
type TAreaChecklistCreate = Pick<TCleaningScheduleArea, "schedule" | "area" | "name" | "type" | "checklist" | "createdBy"
|
|
278
|
-
serviceType: TServiceType;
|
|
279
|
-
};
|
|
282
|
+
type TAreaChecklistCreate = Pick<TCleaningScheduleArea, "schedule" | "serviceType" | "area" | "name" | "type" | "checklist" | "createdBy">;
|
|
280
283
|
type TAreaChecklistBatchCreate = Pick<TCleaningScheduleArea, "schedule" | "createdBy"> & {
|
|
281
284
|
site: string | ObjectId;
|
|
282
285
|
};
|
|
@@ -284,10 +287,9 @@ type TCleaningScheduleAreaGetQuery = {
|
|
|
284
287
|
page?: number;
|
|
285
288
|
limit?: number;
|
|
286
289
|
search?: string;
|
|
287
|
-
serviceType?: TServiceType;
|
|
288
290
|
type?: (typeof allowedTypes)[number] | "all";
|
|
289
291
|
status?: (typeof allowedStatus)[number] | "all";
|
|
290
|
-
} & Pick<TCleaningScheduleArea, "schedule">;
|
|
292
|
+
} & Pick<TCleaningScheduleArea, "schedule" | "serviceType">;
|
|
291
293
|
type TAreaChecklistUpdate = Pick<TCleaningScheduleArea, "checklist">;
|
|
292
294
|
type TAreaChecklistUnitsUpdate = Pick<TAreaChecklistUnits, "approve" | "reject" | "remarks" | "completedBy"> & Pick<TAreaChecklist, "attachment">;
|
|
293
295
|
declare const areaChecklistSchema: Joi.ObjectSchema<any>;
|
|
@@ -359,13 +361,13 @@ declare function useAreaChecklistRepo(): {
|
|
|
359
361
|
page?: number | undefined;
|
|
360
362
|
limit?: number | undefined;
|
|
361
363
|
search?: string | undefined;
|
|
362
|
-
serviceType
|
|
364
|
+
serviceType: TServiceType;
|
|
363
365
|
_id: string | ObjectId;
|
|
364
366
|
}, session?: ClientSession) => Promise<{}>;
|
|
365
367
|
getAreaChecklistById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document>>;
|
|
366
368
|
getAreaChecklistByAreaAndSchedule: ({ schedule, serviceType, area, session, }: {
|
|
367
369
|
schedule: string | ObjectId;
|
|
368
|
-
serviceType
|
|
370
|
+
serviceType: TServiceType;
|
|
369
371
|
area: string | ObjectId;
|
|
370
372
|
session?: ClientSession | undefined;
|
|
371
373
|
}) => Promise<mongodb.WithId<bson.Document>>;
|
|
@@ -393,6 +395,7 @@ declare function useAreaChecklistController(): {
|
|
|
393
395
|
type TSupply = {
|
|
394
396
|
_id?: ObjectId;
|
|
395
397
|
site: string | ObjectId;
|
|
398
|
+
serviceType: TServiceType;
|
|
396
399
|
name: string;
|
|
397
400
|
unitOfMeasurement: string;
|
|
398
401
|
qty: number;
|
|
@@ -401,17 +404,18 @@ type TSupply = {
|
|
|
401
404
|
updatedAt?: string;
|
|
402
405
|
deletedAt?: string;
|
|
403
406
|
};
|
|
404
|
-
type TSupplyCreate = Pick<TSupply, "site" | "name" | "unitOfMeasurement">;
|
|
407
|
+
type TSupplyCreate = Pick<TSupply, "site" | "serviceType" | "name" | "unitOfMeasurement">;
|
|
405
408
|
type TSupplyGetQuery = {
|
|
406
409
|
page?: number;
|
|
407
410
|
limit?: number;
|
|
408
411
|
search?: string;
|
|
409
|
-
} & Pick<TSupply, "site">;
|
|
412
|
+
} & Pick<TSupply, "site" | "serviceType">;
|
|
410
413
|
type TSupplyGetById = Pick<TSupply, "_id" | "name" | "unitOfMeasurement" | "qty">;
|
|
411
414
|
type TSupplyUpdate = Partial<Pick<TSupply, "name" | "unitOfMeasurement" | "qty">>;
|
|
412
415
|
declare const supplySchema: Joi.ObjectSchema<any>;
|
|
413
416
|
declare function MSupply(value: TSupplyCreate): {
|
|
414
417
|
site: string | ObjectId;
|
|
418
|
+
serviceType: ServiceType;
|
|
415
419
|
name: string;
|
|
416
420
|
unitOfMeasurement: string;
|
|
417
421
|
qty: number;
|
|
@@ -426,7 +430,7 @@ declare function useSupplyRepository(): {
|
|
|
426
430
|
createTextIndex: () => Promise<void>;
|
|
427
431
|
createUniqueIndex: () => Promise<void>;
|
|
428
432
|
createSupply: (value: TSupplyCreate, session?: ClientSession) => Promise<ObjectId>;
|
|
429
|
-
getSupplies: ({ page, limit, search, site, }: TSupplyGetQuery) => Promise<{}>;
|
|
433
|
+
getSupplies: ({ page, limit, search, site, serviceType, }: TSupplyGetQuery) => Promise<{}>;
|
|
430
434
|
getSupplyById: (_id: string | ObjectId, session?: ClientSession) => Promise<TSupplyGetById>;
|
|
431
435
|
updateSupply: (_id: string | ObjectId, value: TSupplyUpdate, session?: ClientSession) => Promise<number>;
|
|
432
436
|
deleteSupply: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
|
|
@@ -443,6 +447,7 @@ declare function useSupplyController(): {
|
|
|
443
447
|
type TStock = {
|
|
444
448
|
_id?: ObjectId;
|
|
445
449
|
site: string | ObjectId;
|
|
450
|
+
serviceType: TServiceType;
|
|
446
451
|
supply: string | ObjectId;
|
|
447
452
|
in?: number;
|
|
448
453
|
out?: number;
|
|
@@ -453,18 +458,19 @@ type TStock = {
|
|
|
453
458
|
updatedAt?: string;
|
|
454
459
|
deletedAt?: string;
|
|
455
460
|
};
|
|
456
|
-
type TStockCreate = Pick<TStock, "site" | "supply" | "in" | "out" | "balance" | "remarks">;
|
|
457
|
-
type TStockCreateService = Pick<TStock, "site" | "supply" | "remarks"> & {
|
|
461
|
+
type TStockCreate = Pick<TStock, "site" | "serviceType" | "supply" | "in" | "out" | "balance" | "remarks">;
|
|
462
|
+
type TStockCreateService = Pick<TStock, "site" | "serviceType" | "supply" | "remarks"> & {
|
|
458
463
|
qty: number;
|
|
459
464
|
};
|
|
460
465
|
type TGetStocksQuery = {
|
|
461
466
|
page?: number;
|
|
462
467
|
limit?: number;
|
|
463
468
|
search?: string;
|
|
464
|
-
} & Pick<TStock, "site" | "supply">;
|
|
469
|
+
} & Pick<TStock, "site" | "serviceType" | "supply">;
|
|
465
470
|
declare const stockSchema: Joi.ObjectSchema<any>;
|
|
466
471
|
declare function MStock(value: TStockCreate): {
|
|
467
472
|
site: string | ObjectId;
|
|
473
|
+
serviceType: ServiceType;
|
|
468
474
|
supply: string | ObjectId;
|
|
469
475
|
in: number;
|
|
470
476
|
out: number;
|
|
@@ -479,7 +485,7 @@ declare function MStock(value: TStockCreate): {
|
|
|
479
485
|
declare function useStockRepository(): {
|
|
480
486
|
createIndex: () => Promise<void>;
|
|
481
487
|
createStock: (value: TStockCreate, session?: ClientSession) => Promise<ObjectId>;
|
|
482
|
-
getStocksBySupplyId: ({ page, limit, search, site, supply, }: TGetStocksQuery) => Promise<{}>;
|
|
488
|
+
getStocksBySupplyId: ({ page, limit, search, site, serviceType, supply, }: TGetStocksQuery) => Promise<{}>;
|
|
483
489
|
};
|
|
484
490
|
|
|
485
491
|
declare function useStockService(): {
|
|
@@ -495,6 +501,7 @@ declare const allowedCheckOutItemStatus: string[];
|
|
|
495
501
|
type TCheckOutItem = {
|
|
496
502
|
_id?: ObjectId;
|
|
497
503
|
site: string | ObjectId;
|
|
504
|
+
serviceType: TServiceType;
|
|
498
505
|
supply: string | ObjectId;
|
|
499
506
|
supplyName: string;
|
|
500
507
|
qty: number;
|
|
@@ -506,22 +513,23 @@ type TCheckOutItem = {
|
|
|
506
513
|
updatedAt?: string;
|
|
507
514
|
deletedAt?: string;
|
|
508
515
|
};
|
|
509
|
-
type TCheckOutItemCreate = Pick<TCheckOutItem, "site" | "supply" | "supplyName" | "qty" | "attachment" | "createdBy" | "createdByName">;
|
|
510
|
-
type TCheckOutItemCreateService = Pick<TCheckOutItem, "site" | "supply" | "qty" | "attachment" | "createdBy">;
|
|
511
|
-
type TCheckOutItemCreateByBatchService = Pick<TCheckOutItem, "site" | "createdBy"> & {
|
|
516
|
+
type TCheckOutItemCreate = Pick<TCheckOutItem, "site" | "serviceType" | "supply" | "supplyName" | "qty" | "attachment" | "createdBy" | "createdByName">;
|
|
517
|
+
type TCheckOutItemCreateService = Pick<TCheckOutItem, "site" | "serviceType" | "supply" | "qty" | "attachment" | "createdBy">;
|
|
518
|
+
type TCheckOutItemCreateByBatchService = Pick<TCheckOutItem, "site" | "serviceType" | "createdBy"> & {
|
|
512
519
|
items: Pick<TCheckOutItem, "supply" | "qty" | "attachment">[];
|
|
513
520
|
};
|
|
514
521
|
type TCheckOutItemGetQuery = {
|
|
515
522
|
page?: number;
|
|
516
523
|
limit?: number;
|
|
517
524
|
search?: string;
|
|
518
|
-
} & Pick<TCheckOutItem, "site">;
|
|
519
|
-
type TCheckOutItemGetById = Pick<TCheckOutItem, "_id" | "site" | "supply" | "supplyName" | "qty" | "status"> & {
|
|
525
|
+
} & Pick<TCheckOutItem, "site" | "serviceType">;
|
|
526
|
+
type TCheckOutItemGetById = Pick<TCheckOutItem, "_id" | "site" | "serviceType" | "supply" | "supplyName" | "qty" | "status"> & {
|
|
520
527
|
unitOfMeasurement?: string;
|
|
521
528
|
};
|
|
522
529
|
declare const checkOutItemSchema: Joi.ObjectSchema<any>;
|
|
523
530
|
declare function MCheckOutItem(value: TCheckOutItemCreate): {
|
|
524
531
|
site: string | ObjectId;
|
|
532
|
+
serviceType: ServiceType;
|
|
525
533
|
supply: string | ObjectId;
|
|
526
534
|
supplyName: string;
|
|
527
535
|
qty: number;
|
|
@@ -538,7 +546,7 @@ declare function useCheckOutItemRepository(): {
|
|
|
538
546
|
createIndex: () => Promise<void>;
|
|
539
547
|
createTextIndex: () => Promise<void>;
|
|
540
548
|
createCheckOutItem: (value: TCheckOutItemCreate, session?: ClientSession) => Promise<ObjectId>;
|
|
541
|
-
getCheckOutItems: ({ page, limit, search, site, }: TCheckOutItemGetQuery) => Promise<{}>;
|
|
549
|
+
getCheckOutItems: ({ page, limit, search, site, serviceType, }: TCheckOutItemGetQuery) => Promise<{}>;
|
|
542
550
|
getCheckOutItemById: (_id: string | ObjectId, session?: ClientSession) => Promise<TCheckOutItemGetById>;
|
|
543
551
|
completeCheckOutItem: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
|
|
544
552
|
};
|
|
@@ -608,6 +616,7 @@ declare function useScheduleTaskRepository(): {
|
|
|
608
616
|
getAllScheduleTask: () => Promise<TScheduleTask[]>;
|
|
609
617
|
getScheduleTaskById: (_id: string | ObjectId, session?: ClientSession) => Promise<TScheduleTaskGetById>;
|
|
610
618
|
updateScheduleTask: (_id: string | ObjectId, value: TScheduleTaskUpdate, session?: ClientSession) => Promise<number>;
|
|
619
|
+
deleteScheduleTask: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
|
|
611
620
|
};
|
|
612
621
|
|
|
613
622
|
declare function useScheduleTaskService(): {
|
|
@@ -628,6 +637,7 @@ declare function useScheduleTaskController(): {
|
|
|
628
637
|
getScheduleTasks: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
629
638
|
getScheduleTaskById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
630
639
|
updateScheduleTask: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
640
|
+
deleteScheduleTask: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
631
641
|
};
|
|
632
642
|
|
|
633
643
|
declare function useQRService(): {
|
|
@@ -639,4 +649,4 @@ declare function useQRController(): {
|
|
|
639
649
|
generateQR: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
640
650
|
};
|
|
641
651
|
|
|
642
|
-
export { MArea, MAreaChecklist, MCheckOutItem, MParentChecklist, MScheduleTask, MStock, MSupply, MUnit, ServiceType, TArea, TAreaChecklist, TAreaChecklistBatchCreate, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaChecklistUpdate, TAreaCreate, TAreaGetQuery, TAreaUnits, TAreaUpdate, TAreaUpdateChecklist, TCheckOutItem, TCheckOutItemCreate, TCheckOutItemCreateByBatchService, TCheckOutItemCreateService, TCheckOutItemGetById, TCheckOutItemGetQuery, TCleaningScheduleArea, TCleaningScheduleAreaGetQuery, TGetStocksQuery, TParentChecklist, TParentChecklistGetQuery, TScheduleTask, TScheduleTaskCreate, TScheduleTaskGetById, TScheduleTaskGetQuery, TScheduleTaskUpdate, TServiceType, TStock, TStockCreate, TStockCreateService, TSupply, TSupplyCreate, TSupplyGetById, TSupplyGetQuery, TSupplyUpdate, TUnit, TUnitCreate, TUnitGetQuery, TUnitUpdate, allowedCheckOutItemStatus, allowedChecklistStatus, allowedPeriods, allowedStatus, allowedTypes, areaChecklistSchema, areaSchema, checkOutItemSchema, parentChecklistSchema, scheduleTaskSchema, stockSchema, supplySchema, unitSchema, useAreaChecklistController, useAreaChecklistRepo, useAreaChecklistService, useAreaController, useAreaExportService, useAreaRepo, useAreaService, useCheckOutItemController, useCheckOutItemRepository, useCheckOutItemService, useHygieneDashboardController, useHygieneDashboardRepository, useParentChecklistController, useParentChecklistRepo, useQRController, useQRService, useScheduleTaskController, useScheduleTaskRepository, useScheduleTaskService, useStockController, useStockRepository, useStockService, useSupplyController, useSupplyRepository, useUnitController, useUnitExportService, useUnitRepository, useUnitService };
|
|
652
|
+
export { MArea, MAreaChecklist, MCheckOutItem, MParentChecklist, MScheduleTask, MStock, MSupply, MUnit, ServiceType, TArea, TAreaChecklist, TAreaChecklistBatchCreate, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaChecklistUpdate, TAreaCreate, TAreaGetQuery, TAreaUnits, TAreaUpdate, TAreaUpdateChecklist, TCheckOutItem, TCheckOutItemCreate, TCheckOutItemCreateByBatchService, TCheckOutItemCreateService, TCheckOutItemGetById, TCheckOutItemGetQuery, TCleaningScheduleArea, TCleaningScheduleAreaGetQuery, TGetStocksQuery, TParentChecklist, TParentChecklistCreate, TParentChecklistGetQuery, TScheduleTask, TScheduleTaskCreate, TScheduleTaskGetById, TScheduleTaskGetQuery, TScheduleTaskUpdate, TServiceType, TStock, TStockCreate, TStockCreateService, TSupply, TSupplyCreate, TSupplyGetById, TSupplyGetQuery, TSupplyUpdate, TUnit, TUnitCreate, TUnitGetQuery, TUnitUpdate, allowedCheckOutItemStatus, allowedChecklistStatus, allowedPeriods, allowedStatus, allowedTypes, areaChecklistSchema, areaSchema, checkOutItemSchema, parentChecklistSchema, scheduleTaskSchema, stockSchema, supplySchema, unitSchema, useAreaChecklistController, useAreaChecklistRepo, useAreaChecklistService, useAreaController, useAreaExportService, useAreaRepo, useAreaService, useCheckOutItemController, useCheckOutItemRepository, useCheckOutItemService, useHygieneDashboardController, useHygieneDashboardRepository, useParentChecklistController, useParentChecklistRepo, useQRController, useQRService, useScheduleTaskController, useScheduleTaskRepository, useScheduleTaskService, useStockController, useStockRepository, useStockService, useSupplyController, useSupplyRepository, useUnitController, useUnitExportService, useUnitRepository, useUnitService };
|