@iservice365/module-hygiene 1.1.0 → 1.3.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,23 @@
1
1
  # @iservice365/module-hygiene
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b90e31f: Update Modules - New features
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [b90e31f]
12
+ - @iservice365/module-hygiene@1.3.0
13
+
14
+ ## 1.2.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 1170b7a: Hygiene Request Item - Release
19
+ - d68da92: Hygiene Display Supply - Release
20
+
3
21
  ## 1.1.0
4
22
 
5
23
  ### 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,93 @@ 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
+ day: (typeof allowedDays)[number];
447
+ weekOfMonth?: (typeof allowedWeekOfMonth)[number];
448
+ quarter?: (typeof allowedQuarter)[number];
449
+ month?: (typeof allowedMonths)[number];
450
+ description?: string;
451
+ areas: {
452
+ name: string;
453
+ value: Object;
454
+ }[];
455
+ status?: "active" | "deleted";
456
+ createdAt?: string | Date;
457
+ updatedAt?: string | Date;
458
+ deletedAt?: string | Date;
459
+ };
460
+ type TScheduleTaskCreate = Pick<TScheduleTask, "site" | "title" | "frequency" | "day" | "weekOfMonth" | "quarter" | "month" | "description" | "areas">;
461
+ type TScheduleTaskUpdate = Partial<Pick<TScheduleTask, "title" | "frequency" | "day" | "weekOfMonth" | "quarter" | "month" | "description" | "areas">>;
462
+ type TScheduleTaskGetById = Pick<TScheduleTask, "title" | "frequency" | "day" | "weekOfMonth" | "quarter" | "month" | "description" | "areas" | "createdAt">;
463
+ type TGetScheduleTasksQuery = {
464
+ page?: number;
465
+ limit?: number;
466
+ search?: string;
467
+ } & Pick<TScheduleTask, "site">;
468
+ declare const scheduleTaskSchema: Joi.ObjectSchema<any>;
469
+ declare function MScheduleTask(value: TScheduleTaskCreate): {
470
+ site: string | ObjectId;
471
+ title: string;
472
+ frequency: string;
473
+ day: string;
474
+ weekOfMonth: string | undefined;
475
+ quarter: string | undefined;
476
+ month: string | undefined;
477
+ description: string | undefined;
478
+ areas: {
479
+ name: string;
480
+ value: Object;
481
+ }[];
482
+ status: string;
483
+ createdAt: Date;
484
+ updatedAt: string;
485
+ deletedAt: string;
486
+ };
487
+
488
+ declare function useScheduleTaskRepository(): {
489
+ createIndex: () => Promise<void>;
490
+ createTextIndex: () => Promise<void>;
491
+ createScheduleTask: (value: TScheduleTaskCreate, session?: ClientSession) => Promise<ObjectId>;
492
+ getScheduleTasks: ({ page, limit, search, site, }: TGetScheduleTasksQuery) => Promise<{}>;
493
+ getScheduleTaskById: (_id: string | ObjectId, session?: ClientSession) => Promise<TScheduleTaskGetById>;
494
+ updateScheduleTask: (_id: string | ObjectId, value: TScheduleTaskUpdate, session?: ClientSession) => Promise<number>;
495
+ };
496
+
497
+ declare function useScheduleTaskController(): {
498
+ createScheduleTask: (req: Request, res: Response, next: NextFunction) => Promise<void>;
499
+ getScheduleTasks: (req: Request, res: Response, next: NextFunction) => Promise<void>;
500
+ getScheduleTaskById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
501
+ updateScheduleTask: (req: Request, res: Response, next: NextFunction) => Promise<void>;
423
502
  };
424
503
 
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 };
504
+ 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 };