@iservice365/module-hygiene 0.2.0 → 1.0.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 +6 -0
- package/dist/index.d.ts +66 -84
- package/dist/index.js +759 -914
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +760 -920
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -55,8 +55,9 @@ declare function useAreaRepo(): {
|
|
|
55
55
|
getAreas: ({ page, limit, search, site, }: TAreaGetQuery) => Promise<{}>;
|
|
56
56
|
getAreasForChecklist: ({ site, type, }: TAreaGetAreasForChecklist) => Promise<{}>;
|
|
57
57
|
getAreaById: (_id: string | ObjectId) => Promise<{}>;
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
verifyAreaByUnitId: (unitId: string | ObjectId) => Promise<{}>;
|
|
59
|
+
updateArea: (_id: string | ObjectId, value: TAreaUpdate, session?: ClientSession) => Promise<number>;
|
|
60
|
+
updateAreaChecklist: (unitId: string | ObjectId, name: string, session?: ClientSession) => Promise<number>;
|
|
60
61
|
deleteArea: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
|
|
61
62
|
};
|
|
62
63
|
|
|
@@ -83,7 +84,6 @@ declare function useAreaController(): {
|
|
|
83
84
|
getAreas: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
84
85
|
getAreaById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
85
86
|
updateArea: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
86
|
-
updateAreaChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
87
87
|
deleteArea: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
88
88
|
importArea: (req: MulterRequest, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
|
|
89
89
|
};
|
|
@@ -98,7 +98,7 @@ type TUnit = {
|
|
|
98
98
|
status?: "active" | "deleted";
|
|
99
99
|
};
|
|
100
100
|
type TUnitCreate = Partial<Pick<TUnit, "site" | "name">>;
|
|
101
|
-
type TUnitUpdate =
|
|
101
|
+
type TUnitUpdate = Pick<TUnit, "name">;
|
|
102
102
|
type TGetUnitsQuery = {
|
|
103
103
|
page?: number;
|
|
104
104
|
limit?: number;
|
|
@@ -121,6 +121,8 @@ declare function useUnitService(): {
|
|
|
121
121
|
}) => Promise<{
|
|
122
122
|
message: string;
|
|
123
123
|
}>;
|
|
124
|
+
updateUnit: (_id: string | ObjectId, value: TUnitUpdate) => Promise<number>;
|
|
125
|
+
deleteUnit: (_id: string | ObjectId) => Promise<number>;
|
|
124
126
|
};
|
|
125
127
|
|
|
126
128
|
declare function useUnitRepository(): {
|
|
@@ -129,7 +131,7 @@ declare function useUnitRepository(): {
|
|
|
129
131
|
createUniqueIndex: () => Promise<void>;
|
|
130
132
|
createUnit: (value: TUnitCreate, session?: ClientSession) => Promise<ObjectId>;
|
|
131
133
|
getUnits: ({ page, limit, search, site, }: TGetUnitsQuery) => Promise<{}>;
|
|
132
|
-
updateUnit: (_id: string | ObjectId, value: TUnitUpdate) => Promise<number>;
|
|
134
|
+
updateUnit: (_id: string | ObjectId, value: TUnitUpdate, session?: ClientSession) => Promise<number>;
|
|
133
135
|
deleteUnit: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
|
|
134
136
|
};
|
|
135
137
|
|
|
@@ -167,7 +169,7 @@ declare function useParentChecklistRepo(): {
|
|
|
167
169
|
startDate?: string | Date | undefined;
|
|
168
170
|
endDate?: string | Date | undefined;
|
|
169
171
|
}) => Promise<{}>;
|
|
170
|
-
updateParentChecklistStatuses: (
|
|
172
|
+
updateParentChecklistStatuses: (_id: string | ObjectId, status: (typeof allowedStatus)[number], session?: ClientSession) => Promise<number>;
|
|
171
173
|
};
|
|
172
174
|
|
|
173
175
|
declare function useParentChecklistController(): {
|
|
@@ -184,6 +186,7 @@ type TCleaningScheduleArea = {
|
|
|
184
186
|
checklist: TAreaChecklist[];
|
|
185
187
|
status?: (typeof allowedStatus)[number];
|
|
186
188
|
createdAt?: Date | string;
|
|
189
|
+
completedAt?: Date | string;
|
|
187
190
|
updatedAt?: Date | string;
|
|
188
191
|
};
|
|
189
192
|
type TAreaChecklist = {
|
|
@@ -191,14 +194,17 @@ type TAreaChecklist = {
|
|
|
191
194
|
units: TAreaChecklistUnits[];
|
|
192
195
|
};
|
|
193
196
|
type TAreaChecklistUnits = {
|
|
197
|
+
unit: string | ObjectId;
|
|
194
198
|
name: string;
|
|
195
199
|
status?: (typeof allowedChecklistStatus)[number];
|
|
196
200
|
remarks?: string;
|
|
201
|
+
completedBy?: string | ObjectId;
|
|
197
202
|
timestamp?: Date | string;
|
|
198
203
|
};
|
|
199
204
|
type TAreaChecklistCreate = Pick<TCleaningScheduleArea, "schedule"> & {
|
|
200
205
|
site: string | ObjectId;
|
|
201
206
|
};
|
|
207
|
+
type TAreaChecklistUnitsUpdate = Pick<TAreaChecklistUnits, "remarks" | "completedBy">;
|
|
202
208
|
declare const areaChecklistSchema: Joi.ObjectSchema<any>;
|
|
203
209
|
declare function MAreaChecklist(value: TCleaningScheduleArea): {
|
|
204
210
|
schedule: string | ObjectId;
|
|
@@ -207,9 +213,15 @@ declare function MAreaChecklist(value: TCleaningScheduleArea): {
|
|
|
207
213
|
checklist: TAreaChecklist[];
|
|
208
214
|
status: string;
|
|
209
215
|
createdAt: Date;
|
|
216
|
+
completedAt: string;
|
|
210
217
|
updatedAt: string;
|
|
211
218
|
};
|
|
212
219
|
|
|
220
|
+
declare function useAreaChecklistService(): {
|
|
221
|
+
createAreaChecklist: (value: TAreaChecklistCreate) => Promise<ObjectId[]>;
|
|
222
|
+
completeAreaChecklistUnits: (_id: string | ObjectId, set: number, unitId: string | ObjectId, value: TAreaChecklistUnitsUpdate) => Promise<void>;
|
|
223
|
+
};
|
|
224
|
+
|
|
213
225
|
declare function useAreaChecklistRepo(): {
|
|
214
226
|
createIndex: () => Promise<void>;
|
|
215
227
|
createTextIndex: () => Promise<void>;
|
|
@@ -220,23 +232,26 @@ declare function useAreaChecklistRepo(): {
|
|
|
220
232
|
search?: string | undefined;
|
|
221
233
|
type?: string | undefined;
|
|
222
234
|
schedule: string | ObjectId;
|
|
223
|
-
}) => Promise<{}>;
|
|
224
|
-
getAreaChecklistHistory: ({ page, limit, search,
|
|
235
|
+
}, session?: ClientSession) => Promise<{}>;
|
|
236
|
+
getAreaChecklistHistory: ({ page, limit, search, type, schedule, status, createdAt, }: {
|
|
225
237
|
page?: number | undefined;
|
|
226
238
|
limit?: number | undefined;
|
|
227
239
|
search?: string | undefined;
|
|
228
|
-
|
|
229
|
-
type: (typeof allowedTypes)[number];
|
|
240
|
+
type?: string | undefined;
|
|
230
241
|
schedule: string | ObjectId;
|
|
231
242
|
status?: string | undefined;
|
|
232
243
|
createdAt?: string | Date | undefined;
|
|
233
|
-
user?: string | ObjectId | undefined;
|
|
234
244
|
}) => Promise<{}>;
|
|
235
245
|
getAreaChecklistHistoryDetails: (_id: string | ObjectId) => Promise<{}>;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
246
|
+
getAreaChecklistUnits: ({ page, limit, search, _id, }: {
|
|
247
|
+
page?: number | undefined;
|
|
248
|
+
limit?: number | undefined;
|
|
249
|
+
search?: string | undefined;
|
|
250
|
+
_id: string | ObjectId;
|
|
251
|
+
}, session?: ClientSession) => Promise<{}>;
|
|
252
|
+
getAreaChecklistById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.WithId<bson.Document>>;
|
|
253
|
+
updateAreaChecklistStatus: (_id: string | ObjectId, status: (typeof allowedStatus)[number], session?: ClientSession) => Promise<number>;
|
|
254
|
+
completeAreaChecklistUnits: (_id: string | ObjectId, set: number, unitId: string | ObjectId, value: TAreaChecklistUnitsUpdate, session?: ClientSession) => Promise<number>;
|
|
240
255
|
};
|
|
241
256
|
|
|
242
257
|
declare function useAreaChecklistController(): {
|
|
@@ -244,88 +259,55 @@ declare function useAreaChecklistController(): {
|
|
|
244
259
|
getAllAreaChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
245
260
|
getAreaChecklistHistory: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
246
261
|
getAreaChecklistHistoryDetails: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
submitAreaChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
250
|
-
completeAreaChecklist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
262
|
+
getAreaChecklistUnits: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
263
|
+
completeAreaChecklistUnits: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
251
264
|
};
|
|
252
265
|
|
|
253
|
-
type
|
|
254
|
-
attachments?: Array<string>;
|
|
255
|
-
subject: string;
|
|
256
|
-
category: string | ObjectId;
|
|
257
|
-
highPriority?: boolean;
|
|
258
|
-
block?: string;
|
|
259
|
-
level?: string;
|
|
260
|
-
unit?: string;
|
|
261
|
-
location?: string;
|
|
262
|
-
description: string;
|
|
263
|
-
createdBy: string | ObjectId;
|
|
264
|
-
createdByName?: string;
|
|
265
|
-
serviceProvider?: string | ObjectId;
|
|
266
|
-
organization?: string | ObjectId;
|
|
267
|
-
site?: string | ObjectId;
|
|
268
|
-
};
|
|
269
|
-
type TUnitChecklistMetadata = {
|
|
270
|
-
attachments?: string[];
|
|
271
|
-
remarks?: string;
|
|
272
|
-
workOrder?: TUnitChecklistMetadataWorkOrder;
|
|
273
|
-
};
|
|
274
|
-
type TUnitChecklist = {
|
|
266
|
+
type TSupply = {
|
|
275
267
|
_id?: ObjectId;
|
|
276
268
|
site: string | ObjectId;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
checkedBy?: string | ObjectId;
|
|
285
|
-
metadata?: TUnitChecklistMetadata;
|
|
286
|
-
createdBy?: string | ObjectId;
|
|
287
|
-
createdAt?: Date | string;
|
|
288
|
-
updatedAt?: Date | string;
|
|
269
|
+
name: string;
|
|
270
|
+
unitOfMeasurement: string;
|
|
271
|
+
qty: number;
|
|
272
|
+
createdAt?: string;
|
|
273
|
+
updatedAt?: string;
|
|
274
|
+
deletedAt?: string;
|
|
275
|
+
status?: "active" | "deleted";
|
|
289
276
|
};
|
|
290
|
-
type
|
|
291
|
-
type
|
|
292
|
-
|
|
293
|
-
|
|
277
|
+
type TSupplyCreate = Pick<TSupply, "site" | "name" | "unitOfMeasurement" | "qty">;
|
|
278
|
+
type TSupplyUpdate = Partial<Pick<TSupply, "name" | "unitOfMeasurement" | "qty">>;
|
|
279
|
+
type TGetSupplysQuery = {
|
|
280
|
+
page?: number;
|
|
281
|
+
limit?: number;
|
|
282
|
+
search?: string;
|
|
283
|
+
} & Pick<TSupply, "site">;
|
|
284
|
+
declare const supplySchema: Joi.ObjectSchema<any>;
|
|
285
|
+
declare function MSupply(value: TSupplyCreate): {
|
|
294
286
|
site: string | ObjectId;
|
|
295
|
-
type: string;
|
|
296
|
-
parentChecklist: string | ObjectId;
|
|
297
|
-
areaChecklist: string | ObjectId;
|
|
298
|
-
unit: ObjectId;
|
|
299
287
|
name: string;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
createdBy: string | ObjectId;
|
|
288
|
+
unitOfMeasurement: string;
|
|
289
|
+
qty: number;
|
|
303
290
|
createdAt: Date;
|
|
304
|
-
|
|
291
|
+
status: string;
|
|
292
|
+
updatedAt: string;
|
|
293
|
+
deletedAt: string;
|
|
305
294
|
};
|
|
306
295
|
|
|
307
|
-
declare function
|
|
296
|
+
declare function useSupplyRepository(): {
|
|
308
297
|
createIndex: () => Promise<void>;
|
|
309
298
|
createTextIndex: () => Promise<void>;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
site: string | ObjectId;
|
|
316
|
-
type: (typeof allowedTypes)[number];
|
|
317
|
-
parentChecklist: string | ObjectId;
|
|
318
|
-
areaChecklist: string | ObjectId;
|
|
319
|
-
}) => Promise<{}>;
|
|
320
|
-
getUnitChecklistById: (_id: string | ObjectId) => Promise<mongodb.WithId<bson.Document> | null>;
|
|
321
|
-
updateUnitChecklist: (_id: string | ObjectId, value: TUnitChecklistApprove | TUnitChecklistReject, session?: ClientSession) => Promise<number>;
|
|
299
|
+
createUniqueIndex: () => Promise<void>;
|
|
300
|
+
createSupply: (value: TSupplyCreate, session?: ClientSession) => Promise<ObjectId>;
|
|
301
|
+
getSupplies: ({ page, limit, search, site, }: TGetSupplysQuery) => Promise<{}>;
|
|
302
|
+
updateSupply: (_id: string | ObjectId, value: TSupplyUpdate, session?: ClientSession) => Promise<number>;
|
|
303
|
+
deleteSupply: (_id: string | ObjectId, session?: ClientSession) => Promise<number>;
|
|
322
304
|
};
|
|
323
305
|
|
|
324
|
-
declare function
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
306
|
+
declare function useSupplyController(): {
|
|
307
|
+
createSupply: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
308
|
+
getSupplies: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
309
|
+
updateSupply: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
310
|
+
deleteSupply: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
329
311
|
};
|
|
330
312
|
|
|
331
|
-
export { MArea, MAreaChecklist, MParentChecklist,
|
|
313
|
+
export { MArea, MAreaChecklist, MParentChecklist, MSupply, MUnit, TArea, TAreaChecklist, TAreaChecklistCreate, TAreaChecklistUnits, TAreaChecklistUnitsUpdate, TAreaCreate, TAreaGetAreasForChecklist, TAreaGetQuery, TAreaUnits, TAreaUpdate, TAreaUpdateChecklist, TCleaningScheduleArea, TGetSupplysQuery, TGetUnitsQuery, TParentChecklist, TSupply, TSupplyCreate, TSupplyUpdate, TUnit, TUnitCreate, TUnitUpdate, allowedChecklistStatus, allowedStatus, allowedTypes, areaChecklistSchema, areaSchema, parentChecklistSchema, supplySchema, unitSchema, useAreaChecklistController, useAreaChecklistRepo, useAreaChecklistService, useAreaController, useAreaRepo, useAreaService, useParentChecklistController, useParentChecklistRepo, useSupplyController, useSupplyRepository, useUnitController, useUnitRepository, useUnitService };
|