@7365admin1/module-hygiene 4.17.0 → 4.19.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 +12 -0
- package/dist/index.d.ts +32 -42
- package/dist/index.js +47 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -38
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2,19 +2,9 @@ import * as mongodb from 'mongodb';
|
|
|
2
2
|
import { ObjectId, ClientSession } from 'mongodb';
|
|
3
3
|
import { Request, Response, NextFunction } from 'express';
|
|
4
4
|
import Joi from 'joi';
|
|
5
|
+
import { TAppServiceType, AppServiceType } from '@7365admin1/core';
|
|
5
6
|
import * as bson from 'bson';
|
|
6
7
|
|
|
7
|
-
declare enum ServiceType {
|
|
8
|
-
REAL_ESTATE_DEVELOPER = "real_estate_developer",
|
|
9
|
-
PROPERTY_MANAGEMENT_AGENCY = "property_management_agency",
|
|
10
|
-
SECURITY_AGENCY = "security_agency",
|
|
11
|
-
CLEANING_SERVICES = "cleaning_services",
|
|
12
|
-
MECHANICAL_ELECTRICAL_SERVICES = "mechanical_electrical_services",
|
|
13
|
-
LANDSCAPING_SERVICES = "landscaping_services",
|
|
14
|
-
PEST_CONTROL_SERVICES = "pest_control_services",
|
|
15
|
-
POOL_MAINTENANCE_SERVICES = "pool_maintenance_services"
|
|
16
|
-
}
|
|
17
|
-
type TServiceType = ServiceType;
|
|
18
8
|
declare const allowedTypes: string[];
|
|
19
9
|
declare const allowedStatus: string[];
|
|
20
10
|
declare const allowedPeriods: string[];
|
|
@@ -42,7 +32,7 @@ type TAreaUnits = {
|
|
|
42
32
|
type TArea = {
|
|
43
33
|
_id?: ObjectId;
|
|
44
34
|
site: string | ObjectId;
|
|
45
|
-
serviceType:
|
|
35
|
+
serviceType: TAppServiceType;
|
|
46
36
|
name: string;
|
|
47
37
|
type: (typeof allowedTypes)[number];
|
|
48
38
|
set?: number;
|
|
@@ -66,7 +56,7 @@ type TAreaUpdateChecklist = {
|
|
|
66
56
|
declare const areaSchema: Joi.ObjectSchema<any>;
|
|
67
57
|
declare function MArea(value: TAreaCreate): {
|
|
68
58
|
site: string | ObjectId;
|
|
69
|
-
serviceType:
|
|
59
|
+
serviceType: AppServiceType;
|
|
70
60
|
name: string;
|
|
71
61
|
type: string;
|
|
72
62
|
set: number;
|
|
@@ -83,7 +73,7 @@ declare function useAreaRepo(): {
|
|
|
83
73
|
createUniqueIndex: () => Promise<void>;
|
|
84
74
|
createArea: (value: TAreaCreate, session?: ClientSession) => Promise<ObjectId>;
|
|
85
75
|
getAreas: ({ page, limit, search, type, site, serviceType, }: TAreaGetQuery) => Promise<{}>;
|
|
86
|
-
getAreasForChecklist: (site: string | ObjectId, serviceType:
|
|
76
|
+
getAreasForChecklist: (site: string | ObjectId, serviceType: TAppServiceType) => Promise<{}>;
|
|
87
77
|
getAreaById: (_id: string | ObjectId) => Promise<{}>;
|
|
88
78
|
verifyAreaByUnitId: (unitId: string | ObjectId) => Promise<{}>;
|
|
89
79
|
updateArea: (_id: string | ObjectId, value: TAreaUpdate, session?: ClientSession) => Promise<number>;
|
|
@@ -95,13 +85,13 @@ declare function useAreaService(): {
|
|
|
95
85
|
importArea: ({ dataJson, site, serviceType, }: {
|
|
96
86
|
dataJson: string;
|
|
97
87
|
site: string | ObjectId;
|
|
98
|
-
serviceType:
|
|
88
|
+
serviceType: TAppServiceType;
|
|
99
89
|
}) => Promise<{
|
|
100
90
|
message: string;
|
|
101
91
|
}>;
|
|
102
92
|
exportAreas: ({ site, serviceType, }: {
|
|
103
93
|
site: string | ObjectId;
|
|
104
|
-
serviceType:
|
|
94
|
+
serviceType: TAppServiceType;
|
|
105
95
|
}) => Promise<Buffer>;
|
|
106
96
|
};
|
|
107
97
|
|
|
@@ -127,7 +117,7 @@ declare function useAreaController(): {
|
|
|
127
117
|
type TUnit = {
|
|
128
118
|
_id?: ObjectId;
|
|
129
119
|
site: string | ObjectId;
|
|
130
|
-
serviceType:
|
|
120
|
+
serviceType: TAppServiceType;
|
|
131
121
|
name: string;
|
|
132
122
|
createdAt?: string;
|
|
133
123
|
updatedAt?: string;
|
|
@@ -135,19 +125,19 @@ type TUnit = {
|
|
|
135
125
|
status?: "active" | "deleted";
|
|
136
126
|
};
|
|
137
127
|
type TUnitCreate = {
|
|
138
|
-
serviceType:
|
|
128
|
+
serviceType: TAppServiceType;
|
|
139
129
|
} & Pick<TUnit, "site" | "name">;
|
|
140
130
|
type TUnitGetQuery = {
|
|
141
131
|
page?: number;
|
|
142
132
|
limit?: number;
|
|
143
133
|
search?: string;
|
|
144
|
-
serviceType:
|
|
134
|
+
serviceType: TAppServiceType;
|
|
145
135
|
} & Pick<TUnit, "site">;
|
|
146
136
|
type TUnitUpdate = Pick<TUnit, "name">;
|
|
147
137
|
declare const unitSchema: Joi.ObjectSchema<any>;
|
|
148
138
|
declare function MUnit(value: TUnitCreate): {
|
|
149
139
|
site: string | ObjectId;
|
|
150
|
-
serviceType:
|
|
140
|
+
serviceType: AppServiceType;
|
|
151
141
|
name: string;
|
|
152
142
|
status: string;
|
|
153
143
|
createdAt: Date;
|
|
@@ -159,7 +149,7 @@ declare function useUnitService(): {
|
|
|
159
149
|
importUnit: ({ dataJson, site, serviceType, }: {
|
|
160
150
|
dataJson: string;
|
|
161
151
|
site: string | ObjectId;
|
|
162
|
-
serviceType:
|
|
152
|
+
serviceType: TAppServiceType;
|
|
163
153
|
}) => Promise<{
|
|
164
154
|
message: string;
|
|
165
155
|
}>;
|
|
@@ -167,7 +157,7 @@ declare function useUnitService(): {
|
|
|
167
157
|
deleteUnit: (_id: string | ObjectId) => Promise<number>;
|
|
168
158
|
exportUnits: ({ site, serviceType, }: {
|
|
169
159
|
site: string | ObjectId;
|
|
170
|
-
serviceType:
|
|
160
|
+
serviceType: TAppServiceType;
|
|
171
161
|
}) => Promise<Buffer>;
|
|
172
162
|
};
|
|
173
163
|
|
|
@@ -193,18 +183,18 @@ declare function useUnitController(): {
|
|
|
193
183
|
type TParentChecklist = {
|
|
194
184
|
_id?: ObjectId;
|
|
195
185
|
site: string | ObjectId;
|
|
196
|
-
serviceType:
|
|
186
|
+
serviceType: TAppServiceType;
|
|
197
187
|
status?: (typeof allowedStatus)[number];
|
|
198
188
|
createdAt?: Date | string;
|
|
199
189
|
updatedAt?: Date | string;
|
|
200
190
|
};
|
|
201
191
|
type TParentChecklistCreate = {
|
|
202
192
|
site?: string | ObjectId;
|
|
203
|
-
serviceType?:
|
|
193
|
+
serviceType?: TAppServiceType;
|
|
204
194
|
} & Pick<TParentChecklist, "createdAt">;
|
|
205
195
|
type TParentChecklistGetQuery = {
|
|
206
196
|
site: string | ObjectId;
|
|
207
|
-
serviceType:
|
|
197
|
+
serviceType: TAppServiceType;
|
|
208
198
|
page?: number;
|
|
209
199
|
limit?: number;
|
|
210
200
|
search?: string;
|
|
@@ -214,7 +204,7 @@ type TParentChecklistGetQuery = {
|
|
|
214
204
|
declare const parentChecklistSchema: Joi.ObjectSchema<any>;
|
|
215
205
|
declare function MParentChecklist(value: TParentChecklist): {
|
|
216
206
|
site: string | ObjectId;
|
|
217
|
-
serviceType:
|
|
207
|
+
serviceType: AppServiceType;
|
|
218
208
|
status: string;
|
|
219
209
|
createdAt: string | Date;
|
|
220
210
|
updatedAt: string | Date;
|
|
@@ -250,7 +240,7 @@ declare const allowedChecklistStatus: string[];
|
|
|
250
240
|
type TCleaningScheduleArea = {
|
|
251
241
|
_id?: ObjectId;
|
|
252
242
|
schedule: string | ObjectId;
|
|
253
|
-
serviceType:
|
|
243
|
+
serviceType: TAppServiceType;
|
|
254
244
|
area: string | ObjectId;
|
|
255
245
|
name: string;
|
|
256
246
|
type: (typeof allowedTypes)[number];
|
|
@@ -294,7 +284,7 @@ type TAreaChecklistUnitsUpdate = Pick<TAreaChecklistUnits, "approve" | "reject"
|
|
|
294
284
|
declare const areaChecklistSchema: Joi.ObjectSchema<any>;
|
|
295
285
|
declare function MAreaChecklist(value: TAreaChecklistCreate): {
|
|
296
286
|
schedule: string | ObjectId;
|
|
297
|
-
serviceType:
|
|
287
|
+
serviceType: AppServiceType;
|
|
298
288
|
area: string | ObjectId;
|
|
299
289
|
name: string;
|
|
300
290
|
type: string;
|
|
@@ -359,13 +349,13 @@ declare function useAreaChecklistRepo(): {
|
|
|
359
349
|
page?: number | undefined;
|
|
360
350
|
limit?: number | undefined;
|
|
361
351
|
search?: string | undefined;
|
|
362
|
-
serviceType:
|
|
352
|
+
serviceType: TAppServiceType;
|
|
363
353
|
_id: string | ObjectId;
|
|
364
354
|
}, session?: ClientSession) => Promise<{}>;
|
|
365
355
|
getAreaChecklistById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document>>;
|
|
366
356
|
getAreaChecklistByAreaAndSchedule: ({ schedule, serviceType, area, session, }: {
|
|
367
357
|
schedule: string | ObjectId;
|
|
368
|
-
serviceType:
|
|
358
|
+
serviceType: TAppServiceType;
|
|
369
359
|
area: string | ObjectId;
|
|
370
360
|
session?: ClientSession | undefined;
|
|
371
361
|
}) => Promise<mongodb.WithId<bson.Document>>;
|
|
@@ -375,8 +365,8 @@ declare function useAreaChecklistRepo(): {
|
|
|
375
365
|
updateAreaChecklistUnits: (_id: string | ObjectId, set: number, unitId: string | ObjectId, value: TAreaChecklistUnitsUpdate, session?: ClientSession) => Promise<number>;
|
|
376
366
|
getMaxSetNumberForArea: (areaId: string | ObjectId, session?: ClientSession) => Promise<any>;
|
|
377
367
|
closeExpiredAreaChecklists: () => Promise<number>;
|
|
378
|
-
pushScheduleTaskSets: (scheduleId: string | ObjectId, serviceType:
|
|
379
|
-
insertAutoGenSets: (scheduleId: string | ObjectId, serviceType:
|
|
368
|
+
pushScheduleTaskSets: (scheduleId: string | ObjectId, serviceType: TAppServiceType, areaId: string | ObjectId, scheduleTaskId: string | ObjectId, newSets: TAreaChecklist[]) => Promise<number>;
|
|
369
|
+
insertAutoGenSets: (scheduleId: string | ObjectId, serviceType: TAppServiceType, areaId: string | ObjectId, newSets: any[]) => Promise<number>;
|
|
380
370
|
trimOverflowSets: () => Promise<number>;
|
|
381
371
|
};
|
|
382
372
|
|
|
@@ -393,7 +383,7 @@ declare function useAreaChecklistController(): {
|
|
|
393
383
|
type TSupply = {
|
|
394
384
|
_id?: ObjectId;
|
|
395
385
|
site: string | ObjectId;
|
|
396
|
-
serviceType:
|
|
386
|
+
serviceType: TAppServiceType;
|
|
397
387
|
name: string;
|
|
398
388
|
unitOfMeasurement: string;
|
|
399
389
|
qty: number;
|
|
@@ -413,7 +403,7 @@ type TSupplyUpdate = Partial<Pick<TSupply, "name" | "unitOfMeasurement" | "qty">
|
|
|
413
403
|
declare const supplySchema: Joi.ObjectSchema<any>;
|
|
414
404
|
declare function MSupply(value: TSupplyCreate): {
|
|
415
405
|
site: string | ObjectId;
|
|
416
|
-
serviceType:
|
|
406
|
+
serviceType: AppServiceType;
|
|
417
407
|
name: string;
|
|
418
408
|
unitOfMeasurement: string;
|
|
419
409
|
qty: number;
|
|
@@ -445,7 +435,7 @@ declare function useSupplyController(): {
|
|
|
445
435
|
type TStock = {
|
|
446
436
|
_id?: ObjectId;
|
|
447
437
|
site: string | ObjectId;
|
|
448
|
-
serviceType:
|
|
438
|
+
serviceType: TAppServiceType;
|
|
449
439
|
supply: string | ObjectId;
|
|
450
440
|
in?: number;
|
|
451
441
|
out?: number;
|
|
@@ -468,7 +458,7 @@ type TGetStocksQuery = {
|
|
|
468
458
|
declare const stockSchema: Joi.ObjectSchema<any>;
|
|
469
459
|
declare function MStock(value: TStockCreate): {
|
|
470
460
|
site: string | ObjectId;
|
|
471
|
-
serviceType:
|
|
461
|
+
serviceType: AppServiceType;
|
|
472
462
|
supply: string | ObjectId;
|
|
473
463
|
in: number;
|
|
474
464
|
out: number;
|
|
@@ -499,7 +489,7 @@ declare const allowedCheckOutItemStatus: string[];
|
|
|
499
489
|
type TCheckOutItem = {
|
|
500
490
|
_id?: ObjectId;
|
|
501
491
|
site: string | ObjectId;
|
|
502
|
-
serviceType:
|
|
492
|
+
serviceType: TAppServiceType;
|
|
503
493
|
supply: string | ObjectId;
|
|
504
494
|
supplyName: string;
|
|
505
495
|
qty: number;
|
|
@@ -527,7 +517,7 @@ type TCheckOutItemGetById = Pick<TCheckOutItem, "_id" | "site" | "serviceType" |
|
|
|
527
517
|
declare const checkOutItemSchema: Joi.ObjectSchema<any>;
|
|
528
518
|
declare function MCheckOutItem(value: TCheckOutItemCreate): {
|
|
529
519
|
site: string | ObjectId;
|
|
530
|
-
serviceType:
|
|
520
|
+
serviceType: AppServiceType;
|
|
531
521
|
supply: string | ObjectId;
|
|
532
522
|
supplyName: string;
|
|
533
523
|
qty: number;
|
|
@@ -564,7 +554,7 @@ declare function useCheckOutItemController(): {
|
|
|
564
554
|
type TScheduleTask = {
|
|
565
555
|
_id?: ObjectId;
|
|
566
556
|
site: string | ObjectId;
|
|
567
|
-
serviceType:
|
|
557
|
+
serviceType: TAppServiceType;
|
|
568
558
|
title: string;
|
|
569
559
|
time: string;
|
|
570
560
|
dates: string[];
|
|
@@ -589,7 +579,7 @@ type TScheduleTaskUpdate = Partial<Pick<TScheduleTask, "title" | "time" | "dates
|
|
|
589
579
|
declare const scheduleTaskSchema: Joi.ObjectSchema<any>;
|
|
590
580
|
declare function MScheduleTask(value: TScheduleTaskCreate): {
|
|
591
581
|
site: string | ObjectId;
|
|
592
|
-
serviceType:
|
|
582
|
+
serviceType: AppServiceType;
|
|
593
583
|
title: string;
|
|
594
584
|
time: string;
|
|
595
585
|
dates: string[];
|
|
@@ -616,7 +606,7 @@ declare function useScheduleTaskRepository(): {
|
|
|
616
606
|
};
|
|
617
607
|
|
|
618
608
|
declare function useScheduleTaskService(): {
|
|
619
|
-
checkScheduleConditions: (schedule: any, serviceType:
|
|
609
|
+
checkScheduleConditions: (schedule: any, serviceType: TAppServiceType, currentDate?: Date) => boolean;
|
|
620
610
|
processScheduledTasks: (currentDate?: Date) => Promise<{
|
|
621
611
|
processed: number;
|
|
622
612
|
validated: number;
|
|
@@ -645,4 +635,4 @@ declare function useQRController(): {
|
|
|
645
635
|
generateQR: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
646
636
|
};
|
|
647
637
|
|
|
648
|
-
export { MArea, MAreaChecklist, MCheckOutItem, MParentChecklist, MScheduleTask, MStock, MSupply, MUnit,
|
|
638
|
+
export { MArea, MAreaChecklist, MCheckOutItem, MParentChecklist, 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, TParentChecklistCreate, TParentChecklistGetQuery, TScheduleTask, TScheduleTaskCreate, TScheduleTaskGetById, TScheduleTaskGetQuery, TScheduleTaskUpdate, TStock, TStockCreate, TStockCreateService, TSupply, TSupplyCreate, TSupplyGetById, TSupplyGetQuery, TSupplyUpdate, TUnit, TUnitCreate, TUnitGetQuery, TUnitUpdate, allowedCheckOutItemStatus, allowedChecklistStatus, allowedPeriods, allowedStatus, allowedTypes, areaChecklistSchema, areaSchema, checkOutItemSchema, parentChecklistSchema, scheduleTaskSchema, stockSchema, supplySchema, unitSchema, useAreaChecklistController, useAreaChecklistRepo, useAreaChecklistService, useAreaController, useAreaExportService, useAreaRepo, useAreaService, useCheckOutItemController, useCheckOutItemRepository, useCheckOutItemService, useHygieneDashboardController, useHygieneDashboardRepository, useParentChecklistController, useParentChecklistRepo, useQRController, useQRService, useScheduleTaskController, useScheduleTaskRepository, useScheduleTaskService, useStockController, useStockRepository, useStockService, useSupplyController, useSupplyRepository, useUnitController, useUnitExportService, useUnitRepository, useUnitService };
|