@iservice365/module-hygiene 1.0.3 → 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,29 @@
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
+
21
+ ## 1.1.0
22
+
23
+ ### Minor Changes
24
+
25
+ - 0f65fa2: Hygiene Supply Stock and Request Item - Initial Release
26
+
3
27
  ## 1.0.3
4
28
 
5
29
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -97,7 +97,7 @@ type TUnit = {
97
97
  deletedAt?: string;
98
98
  status?: "active" | "deleted";
99
99
  };
100
- type TUnitCreate = Partial<Pick<TUnit, "site" | "name">>;
100
+ type TUnitCreate = Pick<TUnit, "site" | "name">;
101
101
  type TUnitUpdate = Pick<TUnit, "name">;
102
102
  type TGetUnitsQuery = {
103
103
  page?: number;
@@ -106,10 +106,10 @@ type TGetUnitsQuery = {
106
106
  } & Pick<TUnit, "site">;
107
107
  declare const unitSchema: Joi.ObjectSchema<any>;
108
108
  declare function MUnit(value: TUnitCreate): {
109
- site: string | ObjectId | undefined;
110
- name: string | undefined;
111
- createdAt: Date;
109
+ site: string | ObjectId;
110
+ name: string;
112
111
  status: string;
112
+ createdAt: Date;
113
113
  updatedAt: string;
114
114
  deletedAt: string;
115
115
  };
@@ -274,7 +274,7 @@ type TSupply = {
274
274
  updatedAt?: string;
275
275
  deletedAt?: string;
276
276
  };
277
- type TSupplyCreate = Pick<TSupply, "site" | "name" | "unitOfMeasurement" | "qty">;
277
+ type TSupplyCreate = Pick<TSupply, "site" | "name" | "unitOfMeasurement">;
278
278
  type TSupplyGetById = Pick<TSupply, "_id" | "name" | "unitOfMeasurement" | "qty">;
279
279
  type TSupplyUpdate = Partial<Pick<TSupply, "name" | "unitOfMeasurement" | "qty">>;
280
280
  type TGetSupplysQuery = {
@@ -300,15 +300,11 @@ declare function useSupplyRepository(): {
300
300
  createUniqueIndex: () => Promise<void>;
301
301
  createSupply: (value: TSupplyCreate, session?: ClientSession) => Promise<ObjectId>;
302
302
  getSupplies: ({ page, limit, search, site, }: TGetSupplysQuery) => Promise<{}>;
303
- getSupplyById: (_id: string | ObjectId) => Promise<TSupplyGetById>;
303
+ getSupplyById: (_id: string | ObjectId, session?: ClientSession) => Promise<TSupplyGetById>;
304
304
  updateSupply: (_id: string | ObjectId, value: TSupplyUpdate, session?: ClientSession) => Promise<number>;
305
305
  deleteSupply: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
306
306
  };
307
307
 
308
- declare function useSupplyService(): {
309
- createSupply: (value: TSupplyCreate) => Promise<bson.ObjectId>;
310
- };
311
-
312
308
  declare function useSupplyController(): {
313
309
  createSupply: (req: Request, res: Response, next: NextFunction) => Promise<void>;
314
310
  getSupplies: (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -334,6 +330,11 @@ type TStockCreate = Pick<TStock, "site" | "supply" | "in" | "out" | "balance" |
334
330
  type TStockCreateService = Pick<TStock, "site" | "supply" | "remarks"> & {
335
331
  qty: number;
336
332
  };
333
+ type TGetStocksQuery = {
334
+ page?: number;
335
+ limit?: number;
336
+ search?: string;
337
+ } & Pick<TStock, "site" | "supply">;
337
338
  declare const stockSchema: Joi.ObjectSchema<any>;
338
339
  declare function MStock(value: TStockCreate): {
339
340
  site: string | ObjectId;
@@ -350,15 +351,154 @@ declare function MStock(value: TStockCreate): {
350
351
 
351
352
  declare function useStockRepository(): {
352
353
  createIndex: () => Promise<void>;
353
- createStock: (value: TStockCreate, session?: ClientSession) => Promise<bson.ObjectId>;
354
+ createStock: (value: TStockCreate, session?: ClientSession) => Promise<ObjectId>;
355
+ getStocksBySupplyId: ({ page, limit, search, site, supply, }: TGetStocksQuery) => Promise<{}>;
354
356
  };
355
357
 
356
358
  declare function useStockService(): {
357
- createStock: (value: TStockCreateService) => Promise<bson.ObjectId>;
359
+ createStock: (value: TStockCreateService, out?: boolean) => Promise<bson.ObjectId>;
358
360
  };
359
361
 
360
362
  declare function useStockController(): {
361
363
  createStock: (req: Request, res: Response, next: NextFunction) => Promise<void>;
364
+ getStocksBySupplyId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
365
+ };
366
+
367
+ declare const allowedRequestItemStatus: string[];
368
+ type TRequestItem = {
369
+ _id?: ObjectId;
370
+ site: string | ObjectId;
371
+ supply: string | ObjectId;
372
+ supplyName: string;
373
+ qty: number;
374
+ remarks?: string;
375
+ createdBy: string | ObjectId;
376
+ createdByName: string;
377
+ status?: (typeof allowedRequestItemStatus)[number];
378
+ createdAt?: string;
379
+ updatedAt?: string;
380
+ deletedAt?: string;
381
+ };
382
+ type TRequestItemCreate = Pick<TRequestItem, "site" | "supply" | "supplyName" | "qty" | "createdBy" | "createdByName">;
383
+ type TRequestItemCreateService = Pick<TRequestItem, "site" | "supply" | "qty" | "createdBy">;
384
+ type TRequestItemCreateByBatchService = Pick<TRequestItem, "site" | "createdBy"> & {
385
+ items: Pick<TRequestItem, "supply" | "qty">[];
386
+ };
387
+ type TGetRequestItemsQuery = {
388
+ page?: number;
389
+ limit?: number;
390
+ search?: string;
391
+ } & Pick<TRequestItem, "site">;
392
+ type TGetRequestItemById = Pick<TRequestItem, "_id" | "site" | "supply" | "supplyName" | "qty" | "status"> & {
393
+ unitOfMeasurement?: string;
394
+ };
395
+ declare const requestItemSchema: Joi.ObjectSchema<any>;
396
+ declare function MRequestItem(value: TRequestItemCreate): {
397
+ site: string | ObjectId;
398
+ supply: string | ObjectId;
399
+ supplyName: string;
400
+ qty: number;
401
+ remarks: string;
402
+ createdBy: string | ObjectId;
403
+ createdByName: string;
404
+ status: string;
405
+ createdAt: string;
406
+ updatedAt: string;
407
+ deletedAt: string;
408
+ };
409
+
410
+ declare function useRequestItemRepository(): {
411
+ createIndex: () => Promise<void>;
412
+ createTextIndex: () => Promise<void>;
413
+ createRequestItem: (value: TRequestItemCreate, session?: ClientSession) => Promise<ObjectId>;
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>;
418
+ };
419
+
420
+ declare function useRequestItemService(): {
421
+ createRequestItem: (value: TRequestItemCreateService) => Promise<bson.ObjectId>;
422
+ createRequestItemByBatch: (value: TRequestItemCreateByBatchService) => Promise<bson.ObjectId[]>;
423
+ approveRequestItem: (id: string, remarks?: string) => Promise<bson.ObjectId>;
424
+ disapproveRequestItem: (id: string, remarks?: string) => Promise<number>;
425
+ };
426
+
427
+ declare function useRequestItemController(): {
428
+ createRequestItem: (req: Request, res: Response, next: NextFunction) => Promise<void>;
429
+ createRequestItemByBatch: (req: Request, res: Response, next: NextFunction) => Promise<void>;
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>;
362
502
  };
363
503
 
364
- export { MArea, MAreaChecklist, MParentChecklist, MStock, MSupply, MUnit, TArea, TAreaChecklist, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaCreate, TAreaGetAreasForChecklist, TAreaGetQuery, TAreaUnits, TAreaUpdate, TAreaUpdateChecklist, TCleaningScheduleArea, TGetSupplysQuery, TGetUnitsQuery, TParentChecklist, TStock, TStockCreate, TStockCreateService, TSupply, TSupplyCreate, TSupplyGetById, TSupplyUpdate, TUnit, TUnitCreate, TUnitUpdate, allowedChecklistStatus, allowedStatus, allowedTypes, areaChecklistSchema, areaSchema, parentChecklistSchema, stockSchema, supplySchema, unitSchema, useAreaChecklistController, useAreaChecklistRepo, useAreaChecklistService, useAreaController, useAreaRepo, useAreaService, useParentChecklistController, useParentChecklistRepo, useStockController, useStockRepository, useStockService, useSupplyController, useSupplyRepository, useSupplyService, 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 };