@7365admin1/module-hygiene 4.11.0 → 4.13.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 +52 -14
- package/dist/index.js +520 -205
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +519 -205
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,17 @@ import { Request, Response, NextFunction } from 'express';
|
|
|
4
4
|
import Joi from 'joi';
|
|
5
5
|
import * as bson from 'bson';
|
|
6
6
|
|
|
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;
|
|
7
18
|
declare const allowedTypes: string[];
|
|
8
19
|
declare const allowedStatus: string[];
|
|
9
20
|
declare const allowedPeriods: string[];
|
|
@@ -31,6 +42,7 @@ type TAreaUnits = {
|
|
|
31
42
|
type TArea = {
|
|
32
43
|
_id?: ObjectId;
|
|
33
44
|
site: string | ObjectId;
|
|
45
|
+
serviceType: TServiceType;
|
|
34
46
|
name: string;
|
|
35
47
|
type: (typeof allowedTypes)[number];
|
|
36
48
|
set?: number;
|
|
@@ -40,13 +52,13 @@ type TArea = {
|
|
|
40
52
|
updatedAt?: Date | string;
|
|
41
53
|
deletedAt?: Date | string;
|
|
42
54
|
};
|
|
43
|
-
type TAreaCreate = Pick<TArea, "site" | "name" | "type" | "set" | "units">;
|
|
55
|
+
type TAreaCreate = Pick<TArea, "site" | "serviceType" | "name" | "type" | "set" | "units">;
|
|
44
56
|
type TAreaGetQuery = {
|
|
45
57
|
page?: number;
|
|
46
58
|
limit?: number;
|
|
47
59
|
search?: string;
|
|
48
60
|
type?: (typeof allowedTypes)[number] | "all";
|
|
49
|
-
} & Pick<TArea, "site">;
|
|
61
|
+
} & Pick<TArea, "site" | "serviceType">;
|
|
50
62
|
type TAreaUpdate = Partial<Pick<TArea, "name" | "type" | "set" | "units">>;
|
|
51
63
|
type TAreaUpdateChecklist = {
|
|
52
64
|
units: TAreaUnits[];
|
|
@@ -54,6 +66,7 @@ type TAreaUpdateChecklist = {
|
|
|
54
66
|
declare const areaSchema: Joi.ObjectSchema<any>;
|
|
55
67
|
declare function MArea(value: TAreaCreate): {
|
|
56
68
|
site: string | ObjectId;
|
|
69
|
+
serviceType: ServiceType;
|
|
57
70
|
name: string;
|
|
58
71
|
type: string;
|
|
59
72
|
set: number;
|
|
@@ -69,10 +82,9 @@ declare function useAreaRepo(): {
|
|
|
69
82
|
createTextIndex: () => Promise<void>;
|
|
70
83
|
createUniqueIndex: () => Promise<void>;
|
|
71
84
|
createArea: (value: TAreaCreate, session?: ClientSession) => Promise<ObjectId>;
|
|
72
|
-
getAreas: ({ page, limit, search, type, site, }: TAreaGetQuery) => Promise<{}>;
|
|
73
|
-
getAreasForChecklist: (site: string | ObjectId) => Promise<{}>;
|
|
85
|
+
getAreas: ({ page, limit, search, type, site, serviceType, }: TAreaGetQuery) => Promise<{}>;
|
|
86
|
+
getAreasForChecklist: (site: string | ObjectId, serviceType?: TServiceType) => Promise<{}>;
|
|
74
87
|
getAreaById: (_id: string | ObjectId) => Promise<{}>;
|
|
75
|
-
getAreaByMultipleId: (_id: string[] | ObjectId[]) => Promise<bson.Document[]>;
|
|
76
88
|
verifyAreaByUnitId: (unitId: string | ObjectId) => Promise<{}>;
|
|
77
89
|
updateArea: (_id: string | ObjectId, value: TAreaUpdate, session?: ClientSession) => Promise<number>;
|
|
78
90
|
updateAreaChecklist: (unitId: string | ObjectId, name: string, session?: ClientSession) => Promise<number>;
|
|
@@ -80,13 +92,17 @@ declare function useAreaRepo(): {
|
|
|
80
92
|
};
|
|
81
93
|
|
|
82
94
|
declare function useAreaService(): {
|
|
83
|
-
importArea: ({ dataJson, site, }: {
|
|
95
|
+
importArea: ({ dataJson, site, serviceType, }: {
|
|
84
96
|
dataJson: string;
|
|
85
97
|
site: string | ObjectId;
|
|
98
|
+
serviceType: TServiceType;
|
|
86
99
|
}) => Promise<{
|
|
87
100
|
message: string;
|
|
88
101
|
}>;
|
|
89
|
-
exportAreas: (site
|
|
102
|
+
exportAreas: ({ site, serviceType, }: {
|
|
103
|
+
site: string | ObjectId;
|
|
104
|
+
serviceType: TServiceType;
|
|
105
|
+
}) => Promise<Buffer>;
|
|
90
106
|
};
|
|
91
107
|
|
|
92
108
|
interface MulterRequest extends Request {
|
|
@@ -111,22 +127,27 @@ declare function useAreaController(): {
|
|
|
111
127
|
type TUnit = {
|
|
112
128
|
_id?: ObjectId;
|
|
113
129
|
site: string | ObjectId;
|
|
130
|
+
serviceType: TServiceType;
|
|
114
131
|
name: string;
|
|
115
132
|
createdAt?: string;
|
|
116
133
|
updatedAt?: string;
|
|
117
134
|
deletedAt?: string;
|
|
118
135
|
status?: "active" | "deleted";
|
|
119
136
|
};
|
|
120
|
-
type TUnitCreate =
|
|
137
|
+
type TUnitCreate = {
|
|
138
|
+
serviceType?: TServiceType;
|
|
139
|
+
} & Pick<TUnit, "site" | "name">;
|
|
121
140
|
type TUnitGetQuery = {
|
|
122
141
|
page?: number;
|
|
123
142
|
limit?: number;
|
|
124
143
|
search?: string;
|
|
144
|
+
serviceType?: TServiceType;
|
|
125
145
|
} & Pick<TUnit, "site">;
|
|
126
146
|
type TUnitUpdate = Pick<TUnit, "name">;
|
|
127
147
|
declare const unitSchema: Joi.ObjectSchema<any>;
|
|
128
148
|
declare function MUnit(value: TUnitCreate): {
|
|
129
149
|
site: string | ObjectId;
|
|
150
|
+
serviceType: ServiceType | undefined;
|
|
130
151
|
name: string;
|
|
131
152
|
status: string;
|
|
132
153
|
createdAt: Date;
|
|
@@ -135,15 +156,19 @@ declare function MUnit(value: TUnitCreate): {
|
|
|
135
156
|
};
|
|
136
157
|
|
|
137
158
|
declare function useUnitService(): {
|
|
138
|
-
importUnit: ({ dataJson, site, }: {
|
|
159
|
+
importUnit: ({ dataJson, site, serviceType, }: {
|
|
139
160
|
dataJson: string;
|
|
140
161
|
site: string | ObjectId;
|
|
162
|
+
serviceType?: ServiceType | undefined;
|
|
141
163
|
}) => Promise<{
|
|
142
164
|
message: string;
|
|
143
165
|
}>;
|
|
144
166
|
updateUnit: (_id: string | ObjectId, value: TUnitUpdate) => Promise<number>;
|
|
145
167
|
deleteUnit: (_id: string | ObjectId) => Promise<number>;
|
|
146
|
-
exportUnits: (site
|
|
168
|
+
exportUnits: ({ site, serviceType, }: {
|
|
169
|
+
site: string | ObjectId;
|
|
170
|
+
serviceType?: ServiceType | undefined;
|
|
171
|
+
}) => Promise<Buffer>;
|
|
147
172
|
};
|
|
148
173
|
|
|
149
174
|
declare function useUnitRepository(): {
|
|
@@ -151,7 +176,7 @@ declare function useUnitRepository(): {
|
|
|
151
176
|
createTextIndex: () => Promise<void>;
|
|
152
177
|
createUniqueIndex: () => Promise<void>;
|
|
153
178
|
createUnit: (value: TUnitCreate, session?: ClientSession) => Promise<ObjectId>;
|
|
154
|
-
getUnits: ({ page, limit, search, site, }: TUnitGetQuery) => Promise<{}>;
|
|
179
|
+
getUnits: ({ page, limit, search, site, serviceType, }: TUnitGetQuery) => Promise<{}>;
|
|
155
180
|
updateUnit: (_id: string | ObjectId, value: TUnitUpdate, session?: ClientSession) => Promise<number>;
|
|
156
181
|
deleteUnit: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
|
|
157
182
|
};
|
|
@@ -168,21 +193,24 @@ declare function useUnitController(): {
|
|
|
168
193
|
type TParentChecklist = {
|
|
169
194
|
_id?: ObjectId;
|
|
170
195
|
site?: string | ObjectId;
|
|
196
|
+
serviceType?: TServiceType;
|
|
171
197
|
status?: (typeof allowedStatus)[number];
|
|
172
198
|
createdAt?: Date | string;
|
|
173
199
|
updatedAt?: Date | string;
|
|
174
200
|
};
|
|
175
201
|
type TParentChecklistGetQuery = {
|
|
202
|
+
site: string | ObjectId;
|
|
203
|
+
serviceType: TServiceType;
|
|
176
204
|
page?: number;
|
|
177
205
|
limit?: number;
|
|
178
206
|
search?: string;
|
|
179
|
-
site: string | ObjectId;
|
|
180
207
|
startDate?: string | Date;
|
|
181
208
|
endDate?: string | Date;
|
|
182
209
|
} & Pick<TParentChecklist, "status">;
|
|
183
210
|
declare const parentChecklistSchema: Joi.ObjectSchema<any>;
|
|
184
211
|
declare function MParentChecklist(value: TParentChecklist): {
|
|
185
212
|
site: string | ObjectId | undefined;
|
|
213
|
+
serviceType: ServiceType | undefined;
|
|
186
214
|
status: string;
|
|
187
215
|
createdAt: string | Date;
|
|
188
216
|
updatedAt: string | Date;
|
|
@@ -191,9 +219,13 @@ declare function MParentChecklist(value: TParentChecklist): {
|
|
|
191
219
|
declare function useParentChecklistRepo(): {
|
|
192
220
|
createIndex: () => Promise<void>;
|
|
193
221
|
createParentChecklist: (value: TParentChecklist, session?: ClientSession) => Promise<ObjectId | ObjectId[]>;
|
|
194
|
-
getAllParentChecklist: ({ page, limit, search, site, startDate, endDate, status, }: TParentChecklistGetQuery) => Promise<{}>;
|
|
222
|
+
getAllParentChecklist: ({ page, limit, search, site, startDate, endDate, status, serviceType, }: TParentChecklistGetQuery) => Promise<{}>;
|
|
195
223
|
updateParentChecklistStatuses: (_id: string | ObjectId, status: (typeof allowedStatus)[number], session?: ClientSession) => Promise<number>;
|
|
196
224
|
closeExpiredParentChecklists: () => Promise<number>;
|
|
225
|
+
getTodayParentChecklists: () => Promise<{
|
|
226
|
+
_id: ObjectId;
|
|
227
|
+
site: ObjectId;
|
|
228
|
+
}[]>;
|
|
197
229
|
};
|
|
198
230
|
|
|
199
231
|
declare function useParentChecklistController(): {
|
|
@@ -220,6 +252,8 @@ type TAreaChecklist = {
|
|
|
220
252
|
units: TAreaChecklistUnits[];
|
|
221
253
|
remarks?: string;
|
|
222
254
|
attachment?: string[];
|
|
255
|
+
isScheduleTask?: boolean;
|
|
256
|
+
scheduleTaskId?: string | ObjectId;
|
|
223
257
|
};
|
|
224
258
|
type TAreaChecklistUnits = {
|
|
225
259
|
unit: string | ObjectId;
|
|
@@ -297,6 +331,7 @@ declare function useUnitExportService(): {
|
|
|
297
331
|
declare function useAreaChecklistRepo(): {
|
|
298
332
|
createIndex: () => Promise<void>;
|
|
299
333
|
createTextIndex: () => Promise<void>;
|
|
334
|
+
createUniqueIndex: () => Promise<void>;
|
|
300
335
|
createAreaChecklist: (value: TCleaningScheduleArea, session?: ClientSession) => Promise<ObjectId>;
|
|
301
336
|
getAllAreaChecklist: ({ page, limit, search, type, status, schedule, }: TCleaningScheduleAreaGetQuery, session?: ClientSession) => Promise<{}>;
|
|
302
337
|
getAreaChecklistHistory: ({ page, limit, search, type, schedule, status, createdAt, }: {
|
|
@@ -323,6 +358,9 @@ declare function useAreaChecklistRepo(): {
|
|
|
323
358
|
updateAreaChecklistUnits: (_id: string | ObjectId, set: number, unitId: string | ObjectId, value: TAreaChecklistUnitsUpdate, session?: ClientSession) => Promise<number>;
|
|
324
359
|
getMaxSetNumberForArea: (areaId: string | ObjectId, session?: ClientSession) => Promise<any>;
|
|
325
360
|
closeExpiredAreaChecklists: () => Promise<number>;
|
|
361
|
+
pushScheduleTaskSets: (scheduleId: string | ObjectId, areaId: string | ObjectId, scheduleTaskId: string | ObjectId, newSets: TAreaChecklist[]) => Promise<number>;
|
|
362
|
+
insertAutoGenSets: (scheduleId: string | ObjectId, areaId: string | ObjectId, newSets: any[]) => Promise<number>;
|
|
363
|
+
trimOverflowSets: () => Promise<number>;
|
|
326
364
|
};
|
|
327
365
|
|
|
328
366
|
declare function useAreaChecklistController(): {
|
|
@@ -584,4 +622,4 @@ declare function useQRController(): {
|
|
|
584
622
|
generateQR: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
585
623
|
};
|
|
586
624
|
|
|
587
|
-
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, 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 };
|
|
625
|
+
export { MArea, MAreaChecklist, MCheckOutItem, MParentChecklist, MScheduleTask, MStock, MSupply, MUnit, ServiceType, TArea, TAreaChecklist, TAreaChecklistBatchCreate, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaChecklistUpdate, TAreaCreate, TAreaGetQuery, TAreaUnits, TAreaUpdate, TAreaUpdateChecklist, TCheckOutItem, TCheckOutItemCreate, TCheckOutItemCreateByBatchService, TCheckOutItemCreateService, TCheckOutItemGetById, TCheckOutItemGetQuery, TCleaningScheduleArea, TCleaningScheduleAreaGetQuery, TGetStocksQuery, TParentChecklist, TParentChecklistGetQuery, TScheduleTask, TScheduleTaskCreate, TScheduleTaskGetById, TScheduleTaskGetQuery, TScheduleTaskUpdate, TServiceType, 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 };
|