@7365admin1/module-hygiene 4.0.0 → 4.2.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,17 @@
1
1
  # @7365admin1/module-hygiene
2
2
 
3
+ ## 4.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Hygiene Check Out Item - Initial Release
8
+
9
+ ## 4.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Added `createdBy` field to the schedule task model and cleaning schedule area checklist model, and included it in the projected fields in the area checklist repository.
14
+
3
15
  ## 4.0.0
4
16
 
5
17
  ### Major Changes
package/dist/index.d.ts CHANGED
@@ -205,6 +205,7 @@ type TCleaningScheduleArea = {
205
205
  type: (typeof allowedTypes)[number];
206
206
  checklist: TAreaChecklist[];
207
207
  status?: (typeof allowedStatus)[number];
208
+ createdBy?: string | ObjectId;
208
209
  createdAt?: Date | string;
209
210
  completedAt?: Date | string;
210
211
  updatedAt?: Date | string;
@@ -224,7 +225,7 @@ type TAreaChecklistUnits = {
224
225
  type TAreaChecklistCreate = Pick<TCleaningScheduleArea, "schedule" | "area"> & {
225
226
  site: string | ObjectId;
226
227
  };
227
- type TAreaChecklistBatchCreate = Pick<TCleaningScheduleArea, "schedule"> & {
228
+ type TAreaChecklistBatchCreate = Pick<TCleaningScheduleArea, "schedule" | "createdBy"> & {
228
229
  site: string | ObjectId;
229
230
  };
230
231
  type TCleaningScheduleAreaGetQuery = {
@@ -244,6 +245,7 @@ declare function MAreaChecklist(value: TCleaningScheduleArea): {
244
245
  type: string;
245
246
  checklist: TAreaChecklist[];
246
247
  status: string;
248
+ createdBy: string | ObjectId | undefined;
247
249
  createdAt: Date;
248
250
  completedAt: string;
249
251
  updatedAt: string;
@@ -385,7 +387,7 @@ declare function useStockRepository(): {
385
387
  };
386
388
 
387
389
  declare function useStockService(): {
388
- createStock: (value: TStockCreateService, out?: boolean) => Promise<bson.ObjectId>;
390
+ createStock: (value: TStockCreateService, out?: boolean, session?: ClientSession) => Promise<bson.ObjectId>;
389
391
  };
390
392
 
391
393
  declare function useStockController(): {
@@ -462,6 +464,69 @@ declare function useRequestItemController(): {
462
464
  disapproveRequestItem: (req: Request, res: Response, next: NextFunction) => Promise<void>;
463
465
  };
464
466
 
467
+ declare const allowedCheckOutItemStatus: string[];
468
+ type TCheckOutItem = {
469
+ _id?: ObjectId;
470
+ site: string | ObjectId;
471
+ supply: string | ObjectId;
472
+ supplyName: string;
473
+ qty: number;
474
+ attachment?: string;
475
+ createdBy: string | ObjectId;
476
+ createdByName: string;
477
+ status?: (typeof allowedCheckOutItemStatus)[number];
478
+ createdAt?: string;
479
+ updatedAt?: string;
480
+ deletedAt?: string;
481
+ };
482
+ type TCheckOutItemCreate = Pick<TCheckOutItem, "site" | "supply" | "supplyName" | "qty" | "attachment" | "createdBy" | "createdByName">;
483
+ type TCheckOutItemCreateService = Pick<TCheckOutItem, "site" | "supply" | "qty" | "attachment" | "createdBy">;
484
+ type TCheckOutItemCreateByBatchService = Pick<TCheckOutItem, "site" | "createdBy"> & {
485
+ items: Pick<TCheckOutItem, "supply" | "qty" | "attachment">[];
486
+ };
487
+ type TCheckOutItemGetQuery = {
488
+ page?: number;
489
+ limit?: number;
490
+ search?: string;
491
+ } & Pick<TCheckOutItem, "site">;
492
+ type TCheckOutItemGetById = Pick<TCheckOutItem, "_id" | "site" | "supply" | "supplyName" | "qty" | "status"> & {
493
+ unitOfMeasurement?: string;
494
+ };
495
+ declare const checkOutItemSchema: Joi.ObjectSchema<any>;
496
+ declare function MCheckOutItem(value: TCheckOutItemCreate): {
497
+ site: string | ObjectId;
498
+ supply: string | ObjectId;
499
+ supplyName: string;
500
+ qty: number;
501
+ attachment: string;
502
+ createdBy: string | ObjectId;
503
+ createdByName: string;
504
+ status: string;
505
+ createdAt: string;
506
+ updatedAt: string;
507
+ deletedAt: string;
508
+ };
509
+
510
+ declare function useCheckOutItemRepository(): {
511
+ createIndex: () => Promise<void>;
512
+ createTextIndex: () => Promise<void>;
513
+ createCheckOutItem: (value: TCheckOutItemCreate, session?: ClientSession) => Promise<ObjectId>;
514
+ getCheckOutItems: ({ page, limit, search, site, }: TCheckOutItemGetQuery) => Promise<{}>;
515
+ getCheckOutItemById: (_id: string | ObjectId, session?: ClientSession) => Promise<TCheckOutItemGetById>;
516
+ };
517
+
518
+ declare function useCheckOutItemService(): {
519
+ createCheckOutItem: (value: TCheckOutItemCreateService) => Promise<bson.ObjectId>;
520
+ createCheckOutItemByBatch: (value: TCheckOutItemCreateByBatchService) => Promise<bson.ObjectId[]>;
521
+ };
522
+
523
+ declare function useCheckOutItemController(): {
524
+ createCheckOutItem: (req: Request, res: Response, next: NextFunction) => Promise<void>;
525
+ createCheckOutItemByBatch: (req: Request, res: Response, next: NextFunction) => Promise<void>;
526
+ getCheckOutItems: (req: Request, res: Response, next: NextFunction) => Promise<void>;
527
+ getCheckOutItemById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
528
+ };
529
+
465
530
  type TScheduleTask = {
466
531
  _id?: ObjectId;
467
532
  site: string | ObjectId;
@@ -475,17 +540,18 @@ type TScheduleTask = {
475
540
  value: ObjectId;
476
541
  }[];
477
542
  status?: "active" | "deleted";
543
+ createdBy: string | ObjectId;
478
544
  createdAt?: string | Date;
479
545
  updatedAt?: string | Date;
480
546
  deletedAt?: string | Date;
481
547
  };
482
- type TScheduleTaskCreate = Pick<TScheduleTask, "site" | "title" | "time" | "startDate" | "endDate" | "description" | "areas">;
548
+ type TScheduleTaskCreate = Pick<TScheduleTask, "site" | "title" | "time" | "startDate" | "endDate" | "description" | "areas" | "createdBy">;
483
549
  type TScheduleTaskGetQuery = {
484
550
  page?: number;
485
551
  limit?: number;
486
552
  search?: string;
487
553
  } & Pick<TScheduleTask, "site">;
488
- type TScheduleTaskGetById = Pick<TScheduleTask, "title" | "time" | "startDate" | "endDate" | "description" | "areas" | "status" | "createdAt">;
554
+ type TScheduleTaskGetById = Pick<TScheduleTask, "title" | "time" | "startDate" | "endDate" | "description" | "areas" | "status" | "createdBy" | "createdAt">;
489
555
  type TScheduleTaskUpdate = Partial<Pick<TScheduleTask, "title" | "time" | "startDate" | "endDate" | "description" | "areas">>;
490
556
  declare const scheduleTaskSchema: Joi.ObjectSchema<any>;
491
557
  declare function MScheduleTask(value: TScheduleTaskCreate): {
@@ -500,6 +566,7 @@ declare function MScheduleTask(value: TScheduleTaskCreate): {
500
566
  value: ObjectId;
501
567
  }[];
502
568
  status: string;
569
+ createdBy: string | ObjectId;
503
570
  createdAt: Date;
504
571
  updatedAt: string;
505
572
  deletedAt: string;
@@ -537,4 +604,4 @@ declare function useScheduleTaskController(): {
537
604
  updateScheduleTask: (req: Request, res: Response, next: NextFunction) => Promise<void>;
538
605
  };
539
606
 
540
- export { MArea, MAreaChecklist, MParentChecklist, MRequestItem, MScheduleTask, MStock, MSupply, MUnit, TArea, TAreaChecklist, TAreaChecklistBatchCreate, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaChecklistUpdate, TAreaCreate, TAreaGetQuery, TAreaUnits, TAreaUpdate, TAreaUpdateChecklist, TCleaningScheduleArea, TCleaningScheduleAreaGetQuery, TGetStocksQuery, TParentChecklist, TParentChecklistGetQuery, TRequestItem, TRequestItemCreate, TRequestItemCreateByBatchService, TRequestItemCreateService, TRequestItemGetById, TRequestItemGetQuery, TScheduleTask, TScheduleTaskCreate, TScheduleTaskGetById, TScheduleTaskGetQuery, TScheduleTaskUpdate, TStock, TStockCreate, TStockCreateService, TSupply, TSupplyCreate, TSupplyGetById, TSupplyGetQuery, TSupplyUpdate, TUnit, TUnitCreate, TUnitGetQuery, TUnitUpdate, allowedChecklistStatus, allowedPeriods, allowedRequestItemStatus, allowedStatus, allowedTypes, areaChecklistSchema, areaSchema, parentChecklistSchema, requestItemSchema, scheduleTaskSchema, stockSchema, supplySchema, unitSchema, useAreaChecklistController, useAreaChecklistRepo, useAreaChecklistService, useAreaController, useAreaRepo, useAreaService, useHygieneDashboardController, useHygieneDashboardRepository, useParentChecklistController, useParentChecklistRepo, useRequestItemController, useRequestItemRepository, useRequestItemService, useScheduleTaskController, useScheduleTaskRepository, useScheduleTaskService, useStockController, useStockRepository, useStockService, useSupplyController, useSupplyRepository, useUnitController, useUnitRepository, useUnitService };
607
+ export { MArea, MAreaChecklist, MCheckOutItem, MParentChecklist, MRequestItem, MScheduleTask, MStock, MSupply, MUnit, TArea, TAreaChecklist, TAreaChecklistBatchCreate, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaChecklistUpdate, TAreaCreate, TAreaGetQuery, TAreaUnits, TAreaUpdate, TAreaUpdateChecklist, TCheckOutItem, TCheckOutItemCreate, TCheckOutItemCreateByBatchService, TCheckOutItemCreateService, TCheckOutItemGetById, TCheckOutItemGetQuery, TCleaningScheduleArea, TCleaningScheduleAreaGetQuery, TGetStocksQuery, TParentChecklist, TParentChecklistGetQuery, TRequestItem, TRequestItemCreate, TRequestItemCreateByBatchService, TRequestItemCreateService, TRequestItemGetById, TRequestItemGetQuery, TScheduleTask, TScheduleTaskCreate, TScheduleTaskGetById, TScheduleTaskGetQuery, TScheduleTaskUpdate, TStock, TStockCreate, TStockCreateService, TSupply, TSupplyCreate, TSupplyGetById, TSupplyGetQuery, TSupplyUpdate, TUnit, TUnitCreate, TUnitGetQuery, TUnitUpdate, allowedCheckOutItemStatus, allowedChecklistStatus, allowedPeriods, allowedRequestItemStatus, allowedStatus, allowedTypes, areaChecklistSchema, areaSchema, checkOutItemSchema, parentChecklistSchema, requestItemSchema, scheduleTaskSchema, stockSchema, supplySchema, unitSchema, useAreaChecklistController, useAreaChecklistRepo, useAreaChecklistService, useAreaController, useAreaRepo, useAreaService, useCheckOutItemController, useCheckOutItemRepository, useCheckOutItemService, useHygieneDashboardController, useHygieneDashboardRepository, useParentChecklistController, useParentChecklistRepo, useRequestItemController, useRequestItemRepository, useRequestItemService, useScheduleTaskController, useScheduleTaskRepository, useScheduleTaskService, useStockController, useStockRepository, useStockService, useSupplyController, useSupplyRepository, useUnitController, useUnitRepository, useUnitService };