@iservice365/module-hygiene 1.4.0 → 1.5.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 +6 -0
- package/dist/index.d.ts +29 -12
- package/dist/index.js +377 -107
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +372 -102
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
2
|
import * as mongodb from 'mongodb';
|
|
3
3
|
import { ObjectId, ClientSession } from 'mongodb';
|
|
4
|
-
import { Request, Response, NextFunction } from 'express';
|
|
5
4
|
import * as bson from 'bson';
|
|
5
|
+
import { Request, Response, NextFunction } from 'express';
|
|
6
6
|
|
|
7
7
|
declare const allowedTypes: string[];
|
|
8
8
|
declare const allowedStatus: string[];
|
|
@@ -30,7 +30,6 @@ type TAreaGetQuery = {
|
|
|
30
30
|
} & Pick<TArea, "site">;
|
|
31
31
|
type TAreaCreate = Pick<TArea, "site" | "name" | "type" | "set" | "units">;
|
|
32
32
|
type TAreaUpdate = Partial<Pick<TArea, "name" | "type" | "set" | "units">>;
|
|
33
|
-
type TAreaGetAreasForChecklist = Pick<TArea, "site" | "type">;
|
|
34
33
|
type TAreaUpdateChecklist = {
|
|
35
34
|
units: TAreaUnits[];
|
|
36
35
|
};
|
|
@@ -53,8 +52,9 @@ declare function useAreaRepo(): {
|
|
|
53
52
|
createUniqueIndex: () => Promise<void>;
|
|
54
53
|
createArea: (value: TAreaCreate, session?: ClientSession) => Promise<ObjectId>;
|
|
55
54
|
getAreas: ({ page, limit, search, site, }: TAreaGetQuery) => Promise<{}>;
|
|
56
|
-
getAreasForChecklist: (
|
|
55
|
+
getAreasForChecklist: (site: string | ObjectId) => Promise<{}>;
|
|
57
56
|
getAreaById: (_id: string | ObjectId) => Promise<{}>;
|
|
57
|
+
getAreaByMultipleId: (_id: string[] | ObjectId[]) => Promise<bson.Document[]>;
|
|
58
58
|
verifyAreaByUnitId: (unitId: string | ObjectId) => Promise<{}>;
|
|
59
59
|
updateArea: (_id: string | ObjectId, value: TAreaUpdate, session?: ClientSession) => Promise<number>;
|
|
60
60
|
updateAreaChecklist: (unitId: string | ObjectId, name: string, session?: ClientSession) => Promise<number>;
|
|
@@ -181,6 +181,7 @@ declare const allowedChecklistStatus: string[];
|
|
|
181
181
|
type TCleaningScheduleArea = {
|
|
182
182
|
_id?: ObjectId;
|
|
183
183
|
schedule: string | ObjectId;
|
|
184
|
+
area: string | ObjectId;
|
|
184
185
|
name: string;
|
|
185
186
|
type: (typeof allowedTypes)[number];
|
|
186
187
|
checklist: TAreaChecklist[];
|
|
@@ -208,6 +209,7 @@ type TAreaChecklistUnitsUpdate = Pick<TAreaChecklistUnits, "remarks" | "complete
|
|
|
208
209
|
declare const areaChecklistSchema: Joi.ObjectSchema<any>;
|
|
209
210
|
declare function MAreaChecklist(value: TCleaningScheduleArea): {
|
|
210
211
|
schedule: string | ObjectId;
|
|
212
|
+
area: string | ObjectId;
|
|
211
213
|
name: string;
|
|
212
214
|
type: string;
|
|
213
215
|
checklist: TAreaChecklist[];
|
|
@@ -435,7 +437,6 @@ declare function useRequestItemController(): {
|
|
|
435
437
|
|
|
436
438
|
declare const allowedFrequency: string[];
|
|
437
439
|
declare const allowedDays: string[];
|
|
438
|
-
declare const allowedQuarter: string[];
|
|
439
440
|
declare const allowedWeekOfMonth: string[];
|
|
440
441
|
declare const allowedMonths: string[];
|
|
441
442
|
type TScheduleTask = {
|
|
@@ -444,10 +445,10 @@ type TScheduleTask = {
|
|
|
444
445
|
title: string;
|
|
445
446
|
frequency: (typeof allowedFrequency)[number];
|
|
446
447
|
time: string;
|
|
447
|
-
day
|
|
448
|
+
day?: (typeof allowedDays)[number][];
|
|
448
449
|
weekOfMonth?: (typeof allowedWeekOfMonth)[number];
|
|
449
|
-
quarter?: (typeof allowedQuarter)[number];
|
|
450
450
|
month?: (typeof allowedMonths)[number];
|
|
451
|
+
date?: number;
|
|
451
452
|
description?: string;
|
|
452
453
|
areas: {
|
|
453
454
|
name: string;
|
|
@@ -458,9 +459,9 @@ type TScheduleTask = {
|
|
|
458
459
|
updatedAt?: string | Date;
|
|
459
460
|
deletedAt?: string | Date;
|
|
460
461
|
};
|
|
461
|
-
type TScheduleTaskCreate = Pick<TScheduleTask, "site" | "title" | "frequency" | "time" | "day" | "weekOfMonth" | "
|
|
462
|
-
type TScheduleTaskUpdate = Partial<Pick<TScheduleTask, "title" | "frequency" | "time" | "day" | "weekOfMonth" | "
|
|
463
|
-
type TScheduleTaskGetById = Pick<TScheduleTask, "title" | "frequency" | "time" | "day" | "weekOfMonth" | "
|
|
462
|
+
type TScheduleTaskCreate = Pick<TScheduleTask, "site" | "title" | "frequency" | "time" | "day" | "weekOfMonth" | "month" | "date" | "description" | "areas">;
|
|
463
|
+
type TScheduleTaskUpdate = Partial<Pick<TScheduleTask, "title" | "frequency" | "time" | "day" | "weekOfMonth" | "month" | "date" | "description" | "areas">>;
|
|
464
|
+
type TScheduleTaskGetById = Pick<TScheduleTask, "title" | "frequency" | "time" | "day" | "weekOfMonth" | "month" | "date" | "description" | "areas" | "status" | "createdAt">;
|
|
464
465
|
type TGetScheduleTasksQuery = {
|
|
465
466
|
page?: number;
|
|
466
467
|
limit?: number;
|
|
@@ -472,10 +473,10 @@ declare function MScheduleTask(value: TScheduleTaskCreate): {
|
|
|
472
473
|
title: string;
|
|
473
474
|
frequency: string;
|
|
474
475
|
time: string;
|
|
475
|
-
day: string;
|
|
476
|
+
day: string[] | undefined;
|
|
476
477
|
weekOfMonth: string | undefined;
|
|
477
|
-
quarter: string | undefined;
|
|
478
478
|
month: string | undefined;
|
|
479
|
+
date: number | undefined;
|
|
479
480
|
description: string | undefined;
|
|
480
481
|
areas: {
|
|
481
482
|
name: string;
|
|
@@ -492,15 +493,31 @@ declare function useScheduleTaskRepository(): {
|
|
|
492
493
|
createTextIndex: () => Promise<void>;
|
|
493
494
|
createScheduleTask: (value: TScheduleTaskCreate, session?: ClientSession) => Promise<ObjectId>;
|
|
494
495
|
getScheduleTasks: ({ page, limit, search, site, }: TGetScheduleTasksQuery) => Promise<{}>;
|
|
496
|
+
getAllScheduleTask: () => Promise<TScheduleTask[]>;
|
|
497
|
+
getTasksForScheduleTask: ({ page, limit, search, site, }: TGetScheduleTasksQuery) => Promise<{}>;
|
|
495
498
|
getScheduleTaskById: (_id: string | ObjectId, session?: ClientSession) => Promise<TScheduleTaskGetById>;
|
|
496
499
|
updateScheduleTask: (_id: string | ObjectId, value: TScheduleTaskUpdate, session?: ClientSession) => Promise<number>;
|
|
497
500
|
};
|
|
498
501
|
|
|
502
|
+
declare function useScheduleTaskService(): {
|
|
503
|
+
checkScheduleConditions: (schedule: any, currentDate?: Date) => boolean;
|
|
504
|
+
processScheduledTasks: (currentDate?: Date) => Promise<{
|
|
505
|
+
processed: number;
|
|
506
|
+
validated: number;
|
|
507
|
+
tasks?: undefined;
|
|
508
|
+
} | {
|
|
509
|
+
processed: number;
|
|
510
|
+
validated: number;
|
|
511
|
+
tasks: TScheduleTask[];
|
|
512
|
+
}>;
|
|
513
|
+
};
|
|
514
|
+
|
|
499
515
|
declare function useScheduleTaskController(): {
|
|
500
516
|
createScheduleTask: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
501
517
|
getScheduleTasks: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
518
|
+
getTasksForScheduleTask: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
502
519
|
getScheduleTaskById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
503
520
|
updateScheduleTask: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
504
521
|
};
|
|
505
522
|
|
|
506
|
-
export { MArea, MAreaChecklist, MParentChecklist, MRequestItem, MScheduleTask, MStock, MSupply, MUnit, TArea, TAreaChecklist, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaCreate,
|
|
523
|
+
export { MArea, MAreaChecklist, MParentChecklist, MRequestItem, MScheduleTask, MStock, MSupply, MUnit, TArea, TAreaChecklist, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaCreate, TAreaGetQuery, TAreaUnits, TAreaUpdate, TAreaUpdateChecklist, TCleaningScheduleArea, TGetRequestItemById, TGetRequestItemsQuery, TGetScheduleTasksQuery, TGetStocksQuery, TGetSupplysQuery, TGetUnitsQuery, TParentChecklist, TRequestItem, TRequestItemCreate, TRequestItemCreateByBatchService, TRequestItemCreateService, TScheduleTask, TScheduleTaskCreate, TScheduleTaskGetById, TScheduleTaskUpdate, TStock, TStockCreate, TStockCreateService, TSupply, TSupplyCreate, TSupplyGetById, TSupplyUpdate, TUnit, TUnitCreate, TUnitUpdate, allowedChecklistStatus, allowedDays, allowedFrequency, allowedMonths, allowedRequestItemStatus, allowedStatus, allowedTypes, allowedWeekOfMonth, areaChecklistSchema, areaSchema, parentChecklistSchema, requestItemSchema, scheduleTaskSchema, stockSchema, supplySchema, unitSchema, useAreaChecklistController, useAreaChecklistRepo, useAreaChecklistService, useAreaController, useAreaRepo, useAreaService, useParentChecklistController, useParentChecklistRepo, useRequestItemController, useRequestItemRepository, useRequestItemService, useScheduleTaskController, useScheduleTaskRepository, useScheduleTaskService, useStockController, useStockRepository, useStockService, useSupplyController, useSupplyRepository, useUnitController, useUnitRepository, useUnitService };
|