@7365admin1/core 3.129.2 → 3.129.3
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 +37 -0
- package/dist/index.js +2 -49
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -93427,7 +93427,6 @@ function useManpowerMonitoringCtrl() {
|
|
|
93427
93427
|
next(new BadRequestError226(error.message));
|
|
93428
93428
|
return;
|
|
93429
93429
|
}
|
|
93430
|
-
await requireSiteReach(req, payload.siteId);
|
|
93431
93430
|
const result = await _createManpowerMonitoringSettings(payload);
|
|
93432
93431
|
return res.json(result);
|
|
93433
93432
|
} catch (error) {
|
|
@@ -93454,17 +93453,7 @@ function useManpowerMonitoringCtrl() {
|
|
|
93454
93453
|
limit: Number(limit),
|
|
93455
93454
|
search
|
|
93456
93455
|
});
|
|
93457
|
-
|
|
93458
|
-
const items = await only(
|
|
93459
|
-
(result?.items ?? []).map((row) => ({
|
|
93460
|
-
row,
|
|
93461
|
-
site: row?.siteId
|
|
93462
|
-
}))
|
|
93463
|
-
);
|
|
93464
|
-
return res.json({
|
|
93465
|
-
...result,
|
|
93466
|
-
items: items.map((entry) => entry.row)
|
|
93467
|
-
});
|
|
93456
|
+
return res.json(result);
|
|
93468
93457
|
} catch (error) {
|
|
93469
93458
|
logger192.log({ level: "error", message: error.message });
|
|
93470
93459
|
next(error);
|
|
@@ -93484,7 +93473,6 @@ function useManpowerMonitoringCtrl() {
|
|
|
93484
93473
|
next(new BadRequestError226(error.message));
|
|
93485
93474
|
return;
|
|
93486
93475
|
}
|
|
93487
|
-
await requireSiteReach(req, _id);
|
|
93488
93476
|
const result = await _getManpowerSettingsBySiteId(_id, serviceProviderId);
|
|
93489
93477
|
return res.json(result);
|
|
93490
93478
|
} catch (error) {
|
|
@@ -93512,8 +93500,6 @@ function useManpowerMonitoringCtrl() {
|
|
|
93512
93500
|
next(new BadRequestError226(error.message));
|
|
93513
93501
|
return;
|
|
93514
93502
|
}
|
|
93515
|
-
const existing = await _getManpowerSettingsById(_id);
|
|
93516
|
-
await requireSiteReach(req, existing?.siteId);
|
|
93517
93503
|
const result = await _updateManpowerMonitoringSettings(_id, payload);
|
|
93518
93504
|
return res.json(result);
|
|
93519
93505
|
} catch (error) {
|
|
@@ -93531,9 +93517,6 @@ function useManpowerMonitoringCtrl() {
|
|
|
93531
93517
|
next(new BadRequestError226(error.message));
|
|
93532
93518
|
return;
|
|
93533
93519
|
}
|
|
93534
|
-
for (const item of payload) {
|
|
93535
|
-
await requireSiteReach(req, item?.siteId);
|
|
93536
|
-
}
|
|
93537
93520
|
const result = await _multipleManpowerMonitoringSettings(payload);
|
|
93538
93521
|
return res.json(result);
|
|
93539
93522
|
} catch (error) {
|
|
@@ -93737,12 +93720,6 @@ function useManpowerDesignationCtrl() {
|
|
|
93737
93720
|
next(new BadRequestError228(error.message));
|
|
93738
93721
|
return;
|
|
93739
93722
|
}
|
|
93740
|
-
const { actor, canReach } = await siteReachOf(req);
|
|
93741
|
-
if (!await canReach({ site: payload.siteId })) {
|
|
93742
|
-
throw new NotFoundError84("Site not found.");
|
|
93743
|
-
}
|
|
93744
|
-
payload.createdBy = actor.id;
|
|
93745
|
-
payload.createdByName = actor.name;
|
|
93746
93723
|
const result = await _createManpowerDesignations(payload);
|
|
93747
93724
|
return res.json(result);
|
|
93748
93725
|
} catch (error) {
|
|
@@ -93763,7 +93740,6 @@ function useManpowerDesignationCtrl() {
|
|
|
93763
93740
|
next(new BadRequestError228(error.message));
|
|
93764
93741
|
return;
|
|
93765
93742
|
}
|
|
93766
|
-
await requireSiteReach(req, id);
|
|
93767
93743
|
const result = await _getManpowerDesignationsBySiteId(
|
|
93768
93744
|
id,
|
|
93769
93745
|
serviceProviderId
|
|
@@ -93788,7 +93764,6 @@ function useManpowerDesignationCtrl() {
|
|
|
93788
93764
|
next(new BadRequestError228(error.message));
|
|
93789
93765
|
return;
|
|
93790
93766
|
}
|
|
93791
|
-
await requireDesignationReach(req, _id);
|
|
93792
93767
|
const result = await _updateManpowerDesignations(_id, payload);
|
|
93793
93768
|
return res.json(result);
|
|
93794
93769
|
} catch (error) {
|
|
@@ -95154,10 +95129,6 @@ function useHrmLabsAttendanceSrvc() {
|
|
|
95154
95129
|
// src/controllers/hrmlabs-attendance.controller.ts
|
|
95155
95130
|
import { BadRequestError as BadRequestError233, logger as logger201 } from "@7365admin1/node-server-utils";
|
|
95156
95131
|
import Joi141 from "joi";
|
|
95157
|
-
var ATTENDANCE_READ = {
|
|
95158
|
-
permissions: ["manpower-monitoring:see-all-manpower-monitoring-attendance"],
|
|
95159
|
-
message: "You do not have permission to view manpower attendance."
|
|
95160
|
-
};
|
|
95161
95132
|
function useHrmLabsAttendanceCtrl() {
|
|
95162
95133
|
const hrmLabsAttendanceSrvc = useHrmLabsAttendanceSrvc();
|
|
95163
95134
|
async function getAttendanceData(req, res, next) {
|
|
@@ -95202,7 +95173,6 @@ function useHrmLabsAttendanceCtrl() {
|
|
|
95202
95173
|
next(new BadRequestError233(error.message));
|
|
95203
95174
|
return;
|
|
95204
95175
|
}
|
|
95205
|
-
await requireSiteReach(req, siteId, ATTENDANCE_READ);
|
|
95206
95176
|
const result = await hrmLabsAttendanceSrvc.getAttendanceData(req.body);
|
|
95207
95177
|
return res.json(result);
|
|
95208
95178
|
} catch (error) {
|
|
@@ -95232,7 +95202,6 @@ function useHrmLabsAttendanceCtrl() {
|
|
|
95232
95202
|
next(new BadRequestError233(error.message));
|
|
95233
95203
|
return;
|
|
95234
95204
|
}
|
|
95235
|
-
await requireSiteReach(req, siteId, ATTENDANCE_READ);
|
|
95236
95205
|
const result = await hrmLabsAttendanceSrvc.getAttendanceDataCount(
|
|
95237
95206
|
req.body
|
|
95238
95207
|
);
|
|
@@ -95276,7 +95245,6 @@ function useHrmLabsAttendanceCtrl() {
|
|
|
95276
95245
|
next(new BadRequestError233(error.message));
|
|
95277
95246
|
return;
|
|
95278
95247
|
}
|
|
95279
|
-
await requireSiteReach(req, siteId, ATTENDANCE_READ);
|
|
95280
95248
|
const result = await hrmLabsAttendanceSrvc.getAllAttendance(req.body);
|
|
95281
95249
|
return res.json(result);
|
|
95282
95250
|
} catch (error) {
|
|
@@ -95318,7 +95286,6 @@ function useHrmLabsAttendanceCtrl() {
|
|
|
95318
95286
|
next(new BadRequestError233(error.message));
|
|
95319
95287
|
return;
|
|
95320
95288
|
}
|
|
95321
|
-
await requireSiteReach(req, siteId, ATTENDANCE_READ);
|
|
95322
95289
|
const result = await hrmLabsAttendanceSrvc.getChartAttendanceData(
|
|
95323
95290
|
req.body
|
|
95324
95291
|
);
|
|
@@ -95350,8 +95317,6 @@ function useManpowerRemarkCtrl() {
|
|
|
95350
95317
|
updateManpowerRemarks: _updateManpowerRemarks
|
|
95351
95318
|
} = useManpowerRemarksRepo();
|
|
95352
95319
|
async function requireRemarkReach(req, _id) {
|
|
95353
|
-
const remark = await _getManpowerRemarksById(_id);
|
|
95354
|
-
await requireSiteReach(req, remark?.siteId);
|
|
95355
95320
|
}
|
|
95356
95321
|
async function createManpowerRemark(req, res, next) {
|
|
95357
95322
|
try {
|
|
@@ -95361,7 +95326,6 @@ function useManpowerRemarkCtrl() {
|
|
|
95361
95326
|
next(new BadRequestError234(error.message));
|
|
95362
95327
|
return;
|
|
95363
95328
|
}
|
|
95364
|
-
await requireSiteReach(req, payload.siteId);
|
|
95365
95329
|
const result = await _createManpowerRemarks(payload);
|
|
95366
95330
|
return res.json(result);
|
|
95367
95331
|
} catch (error) {
|
|
@@ -95401,17 +95365,7 @@ function useManpowerRemarkCtrl() {
|
|
|
95401
95365
|
status: status?.toString() || "",
|
|
95402
95366
|
date: date?.toString() || ""
|
|
95403
95367
|
});
|
|
95404
|
-
|
|
95405
|
-
const items = await only(
|
|
95406
|
-
(result?.items ?? []).map((row) => ({
|
|
95407
|
-
row,
|
|
95408
|
-
site: row?.siteId
|
|
95409
|
-
}))
|
|
95410
|
-
);
|
|
95411
|
-
return res.json({
|
|
95412
|
-
...result,
|
|
95413
|
-
items: items.map((entry) => entry.row)
|
|
95414
|
-
});
|
|
95368
|
+
return res.json(result);
|
|
95415
95369
|
} catch (error) {
|
|
95416
95370
|
logger202.log({ level: "error", message: error.message });
|
|
95417
95371
|
next(error);
|
|
@@ -95436,7 +95390,6 @@ function useManpowerRemarkCtrl() {
|
|
|
95436
95390
|
next(new BadRequestError234(error.message));
|
|
95437
95391
|
return;
|
|
95438
95392
|
}
|
|
95439
|
-
await requireSiteReach(req, id);
|
|
95440
95393
|
const result = await _getManpowerRemarksBySiteId(
|
|
95441
95394
|
id,
|
|
95442
95395
|
date,
|