@iservice365/module-hygiene 1.1.0 → 1.4.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 CHANGED
@@ -1,5 +1,29 @@
1
1
  # @iservice365/module-hygiene
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Hygiene Schedule Task - Initial Release
8
+
9
+ ## 1.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - b90e31f: Update Modules - New features
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [b90e31f]
18
+ - @iservice365/module-hygiene@1.3.0
19
+
20
+ ## 1.2.0
21
+
22
+ ### Minor Changes
23
+
24
+ - 1170b7a: Hygiene Request Item - Release
25
+ - d68da92: Hygiene Display Supply - Release
26
+
3
27
  ## 1.1.0
4
28
 
5
29
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -108,8 +108,8 @@ declare const unitSchema: Joi.ObjectSchema<any>;
108
108
  declare function MUnit(value: TUnitCreate): {
109
109
  site: string | ObjectId;
110
110
  name: string;
111
- createdAt: Date;
112
111
  status: string;
112
+ createdAt: Date;
113
113
  updatedAt: string;
114
114
  deletedAt: string;
115
115
  };
@@ -389,6 +389,9 @@ type TGetRequestItemsQuery = {
389
389
  limit?: number;
390
390
  search?: string;
391
391
  } & Pick<TRequestItem, "site">;
392
+ type TGetRequestItemById = Pick<TRequestItem, "_id" | "site" | "supply" | "supplyName" | "qty" | "status"> & {
393
+ unitOfMeasurement?: string;
394
+ };
392
395
  declare const requestItemSchema: Joi.ObjectSchema<any>;
393
396
  declare function MRequestItem(value: TRequestItemCreate): {
394
397
  site: string | ObjectId;
@@ -409,17 +412,95 @@ declare function useRequestItemRepository(): {
409
412
  createTextIndex: () => Promise<void>;
410
413
  createRequestItem: (value: TRequestItemCreate, session?: ClientSession) => Promise<ObjectId>;
411
414
  getRequestItems: ({ page, limit, search, site, }: TGetRequestItemsQuery) => Promise<{}>;
415
+ getRequestItemById: (_id: string | ObjectId, session?: ClientSession) => Promise<TGetRequestItemById>;
416
+ approveRequestItem: (_id: string | ObjectId, remarks?: string, session?: ClientSession) => Promise<number>;
417
+ disapproveRequestItem: (_id: string | ObjectId, remarks?: string, session?: ClientSession) => Promise<number>;
412
418
  };
413
419
 
414
420
  declare function useRequestItemService(): {
415
421
  createRequestItem: (value: TRequestItemCreateService) => Promise<bson.ObjectId>;
416
422
  createRequestItemByBatch: (value: TRequestItemCreateByBatchService) => Promise<bson.ObjectId[]>;
423
+ approveRequestItem: (id: string, remarks?: string) => Promise<bson.ObjectId>;
424
+ disapproveRequestItem: (id: string, remarks?: string) => Promise<number>;
417
425
  };
418
426
 
419
427
  declare function useRequestItemController(): {
420
428
  createRequestItem: (req: Request, res: Response, next: NextFunction) => Promise<void>;
421
429
  createRequestItemByBatch: (req: Request, res: Response, next: NextFunction) => Promise<void>;
422
430
  getRequestItems: (req: Request, res: Response, next: NextFunction) => Promise<void>;
431
+ getRequestItemById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
432
+ approveRequestItem: (req: Request, res: Response, next: NextFunction) => Promise<void>;
433
+ disapproveRequestItem: (req: Request, res: Response, next: NextFunction) => Promise<void>;
434
+ };
435
+
436
+ declare const allowedFrequency: string[];
437
+ declare const allowedDays: string[];
438
+ declare const allowedQuarter: string[];
439
+ declare const allowedWeekOfMonth: string[];
440
+ declare const allowedMonths: string[];
441
+ type TScheduleTask = {
442
+ _id?: ObjectId;
443
+ site: string | ObjectId;
444
+ title: string;
445
+ frequency: (typeof allowedFrequency)[number];
446
+ time: string;
447
+ day: (typeof allowedDays)[number];
448
+ weekOfMonth?: (typeof allowedWeekOfMonth)[number];
449
+ quarter?: (typeof allowedQuarter)[number];
450
+ month?: (typeof allowedMonths)[number];
451
+ description?: string;
452
+ areas: {
453
+ name: string;
454
+ value: Object;
455
+ }[];
456
+ status?: "active" | "deleted";
457
+ createdAt?: string | Date;
458
+ updatedAt?: string | Date;
459
+ deletedAt?: string | Date;
460
+ };
461
+ type TScheduleTaskCreate = Pick<TScheduleTask, "site" | "title" | "frequency" | "time" | "day" | "weekOfMonth" | "quarter" | "month" | "description" | "areas">;
462
+ type TScheduleTaskUpdate = Partial<Pick<TScheduleTask, "title" | "frequency" | "time" | "day" | "weekOfMonth" | "quarter" | "month" | "description" | "areas">>;
463
+ type TScheduleTaskGetById = Pick<TScheduleTask, "title" | "frequency" | "time" | "day" | "weekOfMonth" | "quarter" | "month" | "description" | "areas" | "createdAt">;
464
+ type TGetScheduleTasksQuery = {
465
+ page?: number;
466
+ limit?: number;
467
+ search?: string;
468
+ } & Pick<TScheduleTask, "site">;
469
+ declare const scheduleTaskSchema: Joi.ObjectSchema<any>;
470
+ declare function MScheduleTask(value: TScheduleTaskCreate): {
471
+ site: string | ObjectId;
472
+ title: string;
473
+ frequency: string;
474
+ time: string;
475
+ day: string;
476
+ weekOfMonth: string | undefined;
477
+ quarter: string | undefined;
478
+ month: string | undefined;
479
+ description: string | undefined;
480
+ areas: {
481
+ name: string;
482
+ value: Object;
483
+ }[];
484
+ status: string;
485
+ createdAt: Date;
486
+ updatedAt: string;
487
+ deletedAt: string;
488
+ };
489
+
490
+ declare function useScheduleTaskRepository(): {
491
+ createIndex: () => Promise<void>;
492
+ createTextIndex: () => Promise<void>;
493
+ createScheduleTask: (value: TScheduleTaskCreate, session?: ClientSession) => Promise<ObjectId>;
494
+ getScheduleTasks: ({ page, limit, search, site, }: TGetScheduleTasksQuery) => Promise<{}>;
495
+ getScheduleTaskById: (_id: string | ObjectId, session?: ClientSession) => Promise<TScheduleTaskGetById>;
496
+ updateScheduleTask: (_id: string | ObjectId, value: TScheduleTaskUpdate, session?: ClientSession) => Promise<number>;
497
+ };
498
+
499
+ declare function useScheduleTaskController(): {
500
+ createScheduleTask: (req: Request, res: Response, next: NextFunction) => Promise<void>;
501
+ getScheduleTasks: (req: Request, res: Response, next: NextFunction) => Promise<void>;
502
+ getScheduleTaskById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
503
+ updateScheduleTask: (req: Request, res: Response, next: NextFunction) => Promise<void>;
423
504
  };
424
505
 
425
- export { MArea, MAreaChecklist, MParentChecklist, MRequestItem, MStock, MSupply, MUnit, TArea, TAreaChecklist, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaCreate, TAreaGetAreasForChecklist, TAreaGetQuery, TAreaUnits, TAreaUpdate, TAreaUpdateChecklist, TCleaningScheduleArea, TGetRequestItemsQuery, TGetStocksQuery, TGetSupplysQuery, TGetUnitsQuery, TParentChecklist, TRequestItem, TRequestItemCreate, TRequestItemCreateByBatchService, TRequestItemCreateService, TStock, TStockCreate, TStockCreateService, TSupply, TSupplyCreate, TSupplyGetById, TSupplyUpdate, TUnit, TUnitCreate, TUnitUpdate, allowedChecklistStatus, allowedRequestItemStatus, allowedStatus, allowedTypes, areaChecklistSchema, areaSchema, parentChecklistSchema, requestItemSchema, stockSchema, supplySchema, unitSchema, useAreaChecklistController, useAreaChecklistRepo, useAreaChecklistService, useAreaController, useAreaRepo, useAreaService, useParentChecklistController, useParentChecklistRepo, useRequestItemController, useRequestItemRepository, useRequestItemService, useStockController, useStockRepository, useStockService, useSupplyController, useSupplyRepository, useUnitController, useUnitRepository, useUnitService };
506
+ export { MArea, MAreaChecklist, MParentChecklist, MRequestItem, MScheduleTask, MStock, MSupply, MUnit, TArea, TAreaChecklist, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaCreate, TAreaGetAreasForChecklist, 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, allowedQuarter, 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, useStockController, useStockRepository, useStockService, useSupplyController, useSupplyRepository, useUnitController, useUnitRepository, useUnitService };