@7365admin1/core 2.74.0 → 2.76.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/dist/index.mjs CHANGED
@@ -2725,6 +2725,20 @@ function useUserRepo() {
2725
2725
  throw new InternalServerError5("Failed to update user.");
2726
2726
  }
2727
2727
  }
2728
+ async function updateUserOrgById(id, org, session) {
2729
+ const _id = toObjectId(id);
2730
+ const orgId = toObjectId(org);
2731
+ try {
2732
+ await collection.updateOne(
2733
+ { _id },
2734
+ { $set: { defaultOrg: orgId, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } },
2735
+ { session }
2736
+ );
2737
+ return "Successfully updated user organization.";
2738
+ } catch (error) {
2739
+ throw new InternalServerError5("Failed to update user organization.");
2740
+ }
2741
+ }
2728
2742
  return {
2729
2743
  createIndex,
2730
2744
  createTextIndex,
@@ -2742,7 +2756,8 @@ function useUserRepo() {
2742
2756
  updateDefaultOrgByEmail,
2743
2757
  getUserByEmailStatus,
2744
2758
  updateUserSIDById,
2745
- resetPassword
2759
+ resetPassword,
2760
+ updateUserOrgById
2746
2761
  };
2747
2762
  }
2748
2763
 
@@ -7533,7 +7548,8 @@ function useUserController() {
7533
7548
  "dateOfBirth",
7534
7549
  "profile",
7535
7550
  "gender",
7536
- "defaultOrg"
7551
+ "defaultOrg",
7552
+ "status"
7537
7553
  ).required(),
7538
7554
  value: Joi13.when("field", {
7539
7555
  switch: [
@@ -14472,7 +14488,8 @@ var schemaPlate = Joi36.object({
14472
14488
  });
14473
14489
  var schemaFiles = Joi36.object({
14474
14490
  id: Joi36.string().hex().required(),
14475
- name: Joi36.string().optional().allow(null, "")
14491
+ name: Joi36.string().optional().allow(null, ""),
14492
+ mimeType: Joi36.string().optional().allow(null, "")
14476
14493
  });
14477
14494
  var schemaApprover = Joi36.object({
14478
14495
  id: Joi36.string().hex().required(),
@@ -14521,6 +14538,9 @@ var schemaUpdatePerson = Joi36.object({
14521
14538
  email: Joi36.string().email().optional().allow(null, ""),
14522
14539
  nric: Joi36.string().optional().allow(null, ""),
14523
14540
  remarks: Joi36.string().optional().allow(null, ""),
14541
+ type: Joi36.string().valid(...PERSON_TYPES).optional().allow(null, ""),
14542
+ org: Joi36.string().hex().optional().allow(null, ""),
14543
+ site: Joi36.string().hex().optional().allow(null, ""),
14524
14544
  companyName: Joi36.array().items(Joi36.string()).optional().allow(null, ""),
14525
14545
  plates: Joi36.array().items(schemaFiles).optional().allow(null, ""),
14526
14546
  isOwner: Joi36.boolean().optional().allow(null, ""),
@@ -27326,6 +27346,7 @@ import {
27326
27346
  compileHandlebar as compileHandlebar3,
27327
27347
  getDirectory as getDirectory3
27328
27348
  } from "@7365admin1/node-server-utils";
27349
+ import { ObjectId as ObjectId64 } from "mongodb";
27329
27350
  function usePersonService() {
27330
27351
  const MailerConfig = {
27331
27352
  host: MAILER_TRANSPORT_HOST,
@@ -27347,7 +27368,8 @@ function usePersonService() {
27347
27368
  createUser: addUser,
27348
27369
  getUserByEmail,
27349
27370
  updateUserFieldById: _updateUserFieldById,
27350
- getUserById
27371
+ getUserById,
27372
+ updateUserOrgById: _updateUserOrgById
27351
27373
  } = useUserRepo();
27352
27374
  const { add: addMember } = useMemberRepo();
27353
27375
  const { getById: _getUnitById, updateById: updateUnitById } = useBuildingUnitRepo();
@@ -27438,8 +27460,27 @@ function usePersonService() {
27438
27460
  }
27439
27461
  await _add(value, session);
27440
27462
  await session.commitTransaction();
27463
+ if (value.email && isValidType && value.platform === "mobile") {
27464
+ const emailContent = compileHandlebar3({
27465
+ context: { name: value.name },
27466
+ filePath: getDirectory3(
27467
+ __dirname,
27468
+ "./public/handlebars/registration-pending"
27469
+ )
27470
+ });
27471
+ mailer.sendMail({
27472
+ to: value.email,
27473
+ subject: "Registration Received \u2013 Pending Review",
27474
+ html: emailContent,
27475
+ sender: "iService365"
27476
+ }).catch((error) => {
27477
+ logger84.error(`Failed to send registration pending email: ${error}`);
27478
+ });
27479
+ }
27441
27480
  return "People added successfully.";
27442
27481
  } catch (error) {
27482
+ console.log("error message service", error);
27483
+ console.log("error message service", error.message);
27443
27484
  logger84.error("Error in people service add:", error);
27444
27485
  await session.abortTransaction();
27445
27486
  throw error;
@@ -27460,7 +27501,21 @@ function usePersonService() {
27460
27501
  }
27461
27502
  const isNameUpdated = typeof value.name === "string" && value.name.trim() !== person.name;
27462
27503
  const isOwnerChanged = value.isOwner !== person.isOwner;
27504
+ if (value.org && typeof value.org === "string") {
27505
+ value.org = new ObjectId64(value.org);
27506
+ }
27507
+ if (value.site && typeof value.site === "string") {
27508
+ value.site = new ObjectId64(value.site);
27509
+ }
27510
+ const isOrgChanged = value.org && person.org?.toString() !== value.org.toString();
27463
27511
  await _updateById(_id, value, session);
27512
+ if (isOrgChanged && person.user) {
27513
+ await _updateUserOrgById(
27514
+ person.user.toString(),
27515
+ value.org,
27516
+ session
27517
+ );
27518
+ }
27464
27519
  if (value.unit && (isNameUpdated || isOwnerChanged || value.isOwner)) {
27465
27520
  const unit = await _getUnitById(value.unit.toString());
27466
27521
  if (unit) {
@@ -27482,7 +27537,11 @@ function usePersonService() {
27482
27537
  updatePayload.ownerName = value.name || "";
27483
27538
  }
27484
27539
  if (Object.keys(updatePayload).length > 0 && unit && unit._id) {
27485
- await updateUnitById(unit._id.toString(), updatePayload, session);
27540
+ await updateUnitById(
27541
+ unit._id.toString(),
27542
+ updatePayload,
27543
+ session
27544
+ );
27486
27545
  }
27487
27546
  }
27488
27547
  }
@@ -27572,13 +27631,13 @@ function usePersonService() {
27572
27631
  title = "We request resubmission for your application";
27573
27632
  hideLogin = false;
27574
27633
  statusLogo = `${statusIconPath}/resubmission-icon.png`;
27575
- message2 = `Hi ${person.name}, please resubmit your application with the required updates.`;
27634
+ message2 = `Hi ${person.name}, please resubmit your application with the required updates.${value.remarks ? ` Remarks: ${value.remarks}` : ""}`;
27576
27635
  break;
27577
27636
  case "rejected":
27578
27637
  userStatus = "rejected";
27579
- title = "Your account request for deletion has been rejected.";
27638
+ title = "Your account request for application has been rejected.";
27580
27639
  statusLogo = `${statusIconPath}/deleted-icon.png`;
27581
- message2 = `Hi ${person.name}, unfortunately your application has been rejected. Please contact support for more information.`;
27640
+ message2 = `Hi ${person.name}, unfortunately your application has been rejected.${value.remarks ? ` Remarks: ${value.remarks}` : " Please contact support for more information."}`;
27582
27641
  break;
27583
27642
  default:
27584
27643
  throw new Error("Invalid review status");
@@ -28015,7 +28074,7 @@ function usePersonController() {
28015
28074
  // src/models/robot.model.ts
28016
28075
  import { BadRequestError as BadRequestError106, logger as logger86 } from "@7365admin1/node-server-utils";
28017
28076
  import Joi61 from "joi";
28018
- import { ObjectId as ObjectId64 } from "mongodb";
28077
+ import { ObjectId as ObjectId65 } from "mongodb";
28019
28078
  var metadataSchema4 = {
28020
28079
  orgId: Joi61.string().hex().optional().allow("", null),
28021
28080
  siteId: Joi61.string().hex().optional().allow("", null),
@@ -28040,21 +28099,21 @@ function MRobot(value) {
28040
28099
  }
28041
28100
  if (value.metadata?.orgId) {
28042
28101
  try {
28043
- value.metadata.orgId = new ObjectId64(value.metadata.orgId);
28102
+ value.metadata.orgId = new ObjectId65(value.metadata.orgId);
28044
28103
  } catch (error2) {
28045
28104
  throw new BadRequestError106("Invalid organization ID format.");
28046
28105
  }
28047
28106
  }
28048
28107
  if (value.metadata?.siteId) {
28049
28108
  try {
28050
- value.metadata.siteId = new ObjectId64(value.metadata.siteId);
28109
+ value.metadata.siteId = new ObjectId65(value.metadata.siteId);
28051
28110
  } catch (error2) {
28052
28111
  throw new BadRequestError106("Invalid site ID format.");
28053
28112
  }
28054
28113
  }
28055
28114
  if (value.metadata?.administratorId) {
28056
28115
  try {
28057
- value.metadata.administratorId = new ObjectId64(
28116
+ value.metadata.administratorId = new ObjectId65(
28058
28117
  value.metadata.administratorId
28059
28118
  );
28060
28119
  } catch (error2) {
@@ -28063,7 +28122,7 @@ function MRobot(value) {
28063
28122
  }
28064
28123
  if (value.createdBy) {
28065
28124
  try {
28066
- value.createdBy = new ObjectId64(value.createdBy);
28125
+ value.createdBy = new ObjectId65(value.createdBy);
28067
28126
  } catch (error2) {
28068
28127
  throw new BadRequestError106("Invalid created by ID format.");
28069
28128
  }
@@ -28088,7 +28147,7 @@ function MRobot(value) {
28088
28147
  }
28089
28148
 
28090
28149
  // src/repositories/robot.repo.ts
28091
- import { ObjectId as ObjectId65 } from "mongodb";
28150
+ import { ObjectId as ObjectId66 } from "mongodb";
28092
28151
  import {
28093
28152
  useAtlas as useAtlas54,
28094
28153
  InternalServerError as InternalServerError35,
@@ -28157,12 +28216,12 @@ function useRobotRepo() {
28157
28216
  }) {
28158
28217
  page = page > 0 ? page - 1 : 0;
28159
28218
  try {
28160
- organization = new ObjectId65(organization);
28219
+ organization = new ObjectId66(organization);
28161
28220
  } catch (error) {
28162
28221
  throw new BadRequestError107("Invalid organization ID format.");
28163
28222
  }
28164
28223
  try {
28165
- site = new ObjectId65(site);
28224
+ site = new ObjectId66(site);
28166
28225
  } catch (error) {
28167
28226
  throw new BadRequestError107("Invalid site ID format.");
28168
28227
  }
@@ -28385,7 +28444,7 @@ function useRobotController() {
28385
28444
 
28386
28445
  // src/models/patrol-question.model.ts
28387
28446
  import { BadRequestError as BadRequestError110, logger as logger89 } from "@7365admin1/node-server-utils";
28388
- import { ObjectId as ObjectId66 } from "mongodb";
28447
+ import { ObjectId as ObjectId67 } from "mongodb";
28389
28448
  import Joi63 from "joi";
28390
28449
  var schemaPatrolQuestion = Joi63.object({
28391
28450
  _id: Joi63.string().hex().optional(),
@@ -28411,14 +28470,14 @@ function MPatrolQuestion(value) {
28411
28470
  }
28412
28471
  if (value._id && typeof value._id === "string") {
28413
28472
  try {
28414
- value._id = new ObjectId66(value._id);
28473
+ value._id = new ObjectId67(value._id);
28415
28474
  } catch {
28416
28475
  throw new BadRequestError110("Invalid _id format");
28417
28476
  }
28418
28477
  }
28419
28478
  return {
28420
- _id: value._id ?? new ObjectId66(),
28421
- site: new ObjectId66(value.site),
28479
+ _id: value._id ?? new ObjectId67(),
28480
+ site: new ObjectId67(value.site),
28422
28481
  question: value.question,
28423
28482
  answers: value.answers,
28424
28483
  status: value.status ?? "active",
@@ -28439,7 +28498,7 @@ import {
28439
28498
  useAtlas as useAtlas55,
28440
28499
  useCache as useCache35
28441
28500
  } from "@7365admin1/node-server-utils";
28442
- import { ObjectId as ObjectId67 } from "mongodb";
28501
+ import { ObjectId as ObjectId68 } from "mongodb";
28443
28502
  function usePatrolQuestionRepo() {
28444
28503
  const db = useAtlas55.getDb();
28445
28504
  if (!db) {
@@ -28518,7 +28577,7 @@ function usePatrolQuestionRepo() {
28518
28577
  { answers: { $regex: search, $options: "i" } }
28519
28578
  ]
28520
28579
  },
28521
- ...ObjectId67.isValid(site) && { site: new ObjectId67(site) }
28580
+ ...ObjectId68.isValid(site) && { site: new ObjectId68(site) }
28522
28581
  };
28523
28582
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
28524
28583
  const cacheOptions = {
@@ -28558,7 +28617,7 @@ function usePatrolQuestionRepo() {
28558
28617
  }
28559
28618
  async function updateById(_id, value, session) {
28560
28619
  try {
28561
- _id = new ObjectId67(_id);
28620
+ _id = new ObjectId68(_id);
28562
28621
  } catch (error) {
28563
28622
  throw new BadRequestError111(
28564
28623
  "Invalid patrol question transaction ID format."
@@ -28579,7 +28638,7 @@ function usePatrolQuestionRepo() {
28579
28638
  }
28580
28639
  async function deleteById(_id) {
28581
28640
  try {
28582
- _id = new ObjectId67(_id);
28641
+ _id = new ObjectId68(_id);
28583
28642
  } catch (error) {
28584
28643
  throw new BadRequestError111("Invalid customer ID format.");
28585
28644
  }
@@ -28601,7 +28660,7 @@ function usePatrolQuestionRepo() {
28601
28660
  }
28602
28661
  async function getById(_id, session) {
28603
28662
  try {
28604
- _id = new ObjectId67(_id);
28663
+ _id = new ObjectId68(_id);
28605
28664
  } catch (error) {
28606
28665
  throw new BadRequestError111("Invalid patrol question ID format.");
28607
28666
  }
@@ -28776,7 +28835,7 @@ function usePatrolQuestionController() {
28776
28835
 
28777
28836
  // src/models/patrol-route.model.ts
28778
28837
  import { BadRequestError as BadRequestError113, logger as logger92 } from "@7365admin1/node-server-utils";
28779
- import { ObjectId as ObjectId68 } from "mongodb";
28838
+ import { ObjectId as ObjectId69 } from "mongodb";
28780
28839
  import Joi65 from "joi";
28781
28840
  var schemeCamera = Joi65.object({
28782
28841
  camera: Joi65.string().hex().required(),
@@ -28824,14 +28883,14 @@ function MPatrolRoute(value) {
28824
28883
  }
28825
28884
  if (value._id && typeof value._id === "string") {
28826
28885
  try {
28827
- value._id = new ObjectId68(value._id);
28886
+ value._id = new ObjectId69(value._id);
28828
28887
  } catch {
28829
28888
  throw new BadRequestError113("Invalid _id format");
28830
28889
  }
28831
28890
  }
28832
28891
  if (value.assignee && Array.isArray(value.assignee)) {
28833
28892
  try {
28834
- value.assignee = value.assignee.map((id) => new ObjectId68(id));
28893
+ value.assignee = value.assignee.map((id) => new ObjectId69(id));
28835
28894
  } catch {
28836
28895
  throw new BadRequestError113("Invalid assignee id format");
28837
28896
  }
@@ -28840,7 +28899,7 @@ function MPatrolRoute(value) {
28840
28899
  value.cameras = value.cameras.map((camera) => {
28841
28900
  if (typeof camera.camera === "string") {
28842
28901
  try {
28843
- camera.camera = new ObjectId68(camera.camera);
28902
+ camera.camera = new ObjectId69(camera.camera);
28844
28903
  } catch {
28845
28904
  throw new BadRequestError113("Invalid camera id format");
28846
28905
  }
@@ -28848,7 +28907,7 @@ function MPatrolRoute(value) {
28848
28907
  camera.questions = camera.questions.map((question) => {
28849
28908
  if (typeof question.questionId === "string") {
28850
28909
  try {
28851
- question.questionId = new ObjectId68(question.questionId);
28910
+ question.questionId = new ObjectId69(question.questionId);
28852
28911
  } catch {
28853
28912
  throw new BadRequestError113("Invalid question id format");
28854
28913
  }
@@ -28859,8 +28918,8 @@ function MPatrolRoute(value) {
28859
28918
  });
28860
28919
  }
28861
28920
  return {
28862
- _id: value._id ?? new ObjectId68(),
28863
- site: new ObjectId68(value.site),
28921
+ _id: value._id ?? new ObjectId69(),
28922
+ site: new ObjectId69(value.site),
28864
28923
  name: value.name,
28865
28924
  assignee: value.assignee,
28866
28925
  start: value.start,
@@ -28886,7 +28945,7 @@ import {
28886
28945
  useAtlas as useAtlas56,
28887
28946
  useCache as useCache36
28888
28947
  } from "@7365admin1/node-server-utils";
28889
- import { ObjectId as ObjectId69 } from "mongodb";
28948
+ import { ObjectId as ObjectId70 } from "mongodb";
28890
28949
  function usePatrolRouteRepo() {
28891
28950
  const db = useAtlas56.getDb();
28892
28951
  if (!db) {
@@ -28962,7 +29021,7 @@ function usePatrolRouteRepo() {
28962
29021
  page = page > 0 ? page - 1 : 0;
28963
29022
  const query = {
28964
29023
  status,
28965
- ...ObjectId69.isValid(site) && { site: new ObjectId69(site) }
29024
+ ...ObjectId70.isValid(site) && { site: new ObjectId70(site) }
28966
29025
  };
28967
29026
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
28968
29027
  const cacheOptions = {
@@ -29045,20 +29104,20 @@ function usePatrolRouteRepo() {
29045
29104
  }
29046
29105
  async function updateById(_id, value, session) {
29047
29106
  try {
29048
- _id = new ObjectId69(_id);
29107
+ _id = new ObjectId70(_id);
29049
29108
  } catch (error) {
29050
29109
  throw new BadRequestError114("Invalid patrol route transaction ID format.");
29051
29110
  }
29052
- if (value.site && ObjectId69.isValid(value.site.toString())) {
29111
+ if (value.site && ObjectId70.isValid(value.site.toString())) {
29053
29112
  try {
29054
- value.site = new ObjectId69(value.site.toString());
29113
+ value.site = new ObjectId70(value.site.toString());
29055
29114
  } catch {
29056
29115
  throw new BadRequestError114("Invalid _id format");
29057
29116
  }
29058
29117
  }
29059
29118
  if (value.assignee && Array.isArray(value.assignee)) {
29060
29119
  try {
29061
- value.assignee = value.assignee.map((id) => new ObjectId69(id));
29120
+ value.assignee = value.assignee.map((id) => new ObjectId70(id));
29062
29121
  } catch {
29063
29122
  throw new BadRequestError114("Invalid _id format");
29064
29123
  }
@@ -29078,7 +29137,7 @@ function usePatrolRouteRepo() {
29078
29137
  }
29079
29138
  async function deleteById(_id) {
29080
29139
  try {
29081
- _id = new ObjectId69(_id);
29140
+ _id = new ObjectId70(_id);
29082
29141
  } catch (error) {
29083
29142
  throw new BadRequestError114("Invalid patrol route transaction ID format.");
29084
29143
  }
@@ -29127,7 +29186,7 @@ function usePatrolRouteRepo() {
29127
29186
  const query = {
29128
29187
  status,
29129
29188
  ...search && { $text: { $search: search } },
29130
- ...ObjectId69.isValid(site) && { site: new ObjectId69(site) }
29189
+ ...ObjectId70.isValid(site) && { site: new ObjectId70(site) }
29131
29190
  };
29132
29191
  if (day && start) {
29133
29192
  const [hour, minute] = start?.split(":") ?? ["0", "0"];
@@ -29210,7 +29269,7 @@ function usePatrolRouteRepo() {
29210
29269
  id: "$_id",
29211
29270
  start: startOfDay,
29212
29271
  end: endOfDay,
29213
- site: ObjectId69.isValid(site) ? new ObjectId69(site) : null
29272
+ site: ObjectId70.isValid(site) ? new ObjectId70(site) : null
29214
29273
  },
29215
29274
  pipeline: [
29216
29275
  {
@@ -29256,7 +29315,7 @@ function usePatrolRouteRepo() {
29256
29315
  }
29257
29316
  async function getById(_id, session) {
29258
29317
  try {
29259
- _id = new ObjectId69(_id);
29318
+ _id = new ObjectId70(_id);
29260
29319
  } catch (error) {
29261
29320
  throw new BadRequestError114("Invalid patrol log ID format.");
29262
29321
  }
@@ -29501,7 +29560,7 @@ function usePatrolRouteController() {
29501
29560
 
29502
29561
  // src/models/patrol-log.model.ts
29503
29562
  import { BadRequestError as BadRequestError116, logger as logger95 } from "@7365admin1/node-server-utils";
29504
- import { ObjectId as ObjectId70 } from "mongodb";
29563
+ import { ObjectId as ObjectId71 } from "mongodb";
29505
29564
  import Joi67 from "joi";
29506
29565
  var schemeLogCamera = Joi67.object({
29507
29566
  camera: Joi67.string().hex().required(),
@@ -29562,41 +29621,41 @@ function MPatrolLog(value) {
29562
29621
  }
29563
29622
  if (value._id && typeof value._id === "string") {
29564
29623
  try {
29565
- value._id = new ObjectId70(value._id);
29624
+ value._id = new ObjectId71(value._id);
29566
29625
  } catch {
29567
29626
  throw new BadRequestError116("Invalid _id format");
29568
29627
  }
29569
29628
  }
29570
29629
  if (value.route && typeof value.route === "string") {
29571
29630
  try {
29572
- value.route = new ObjectId70(value.route);
29631
+ value.route = new ObjectId71(value.route);
29573
29632
  } catch {
29574
29633
  throw new BadRequestError116("Invalid route id format");
29575
29634
  }
29576
29635
  }
29577
29636
  if (value.site && typeof value.site === "string") {
29578
29637
  try {
29579
- value.site = new ObjectId70(value.site);
29638
+ value.site = new ObjectId71(value.site);
29580
29639
  } catch {
29581
29640
  throw new BadRequestError116("Invalid site id format");
29582
29641
  }
29583
29642
  }
29584
29643
  const assignee = (value.assignee || []).map((id) => {
29585
29644
  try {
29586
- return new ObjectId70(id);
29645
+ return new ObjectId71(id);
29587
29646
  } catch {
29588
29647
  throw new BadRequestError116("Invalid assignee id format");
29589
29648
  }
29590
29649
  });
29591
29650
  if (value.incidentReport && typeof value.incidentReport.id === "string") {
29592
29651
  try {
29593
- value.incidentReport.id = new ObjectId70(value.incidentReport.id);
29652
+ value.incidentReport.id = new ObjectId71(value.incidentReport.id);
29594
29653
  } catch {
29595
29654
  throw new BadRequestError116("Invalid incident report id format");
29596
29655
  }
29597
29656
  }
29598
29657
  return {
29599
- _id: value._id ?? new ObjectId70(),
29658
+ _id: value._id ?? new ObjectId71(),
29600
29659
  site: value.site,
29601
29660
  name: value.name,
29602
29661
  assignee,
@@ -29624,7 +29683,7 @@ import {
29624
29683
  useAtlas as useAtlas57,
29625
29684
  useCache as useCache37
29626
29685
  } from "@7365admin1/node-server-utils";
29627
- import { ObjectId as ObjectId71 } from "mongodb";
29686
+ import { ObjectId as ObjectId72 } from "mongodb";
29628
29687
  function usePatrolLogRepo() {
29629
29688
  const db = useAtlas57.getDb();
29630
29689
  if (!db) {
@@ -29715,7 +29774,7 @@ function usePatrolLogRepo() {
29715
29774
  };
29716
29775
  }
29717
29776
  const query = {
29718
- ...ObjectId71.isValid(site) && { site: new ObjectId71(site) },
29777
+ ...ObjectId72.isValid(site) && { site: new ObjectId72(site) },
29719
29778
  ...dateExpr
29720
29779
  };
29721
29780
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
@@ -29855,7 +29914,7 @@ function usePatrolLogRepo() {
29855
29914
  }
29856
29915
  async function updateById(_id, value, session) {
29857
29916
  try {
29858
- _id = new ObjectId71(_id);
29917
+ _id = new ObjectId72(_id);
29859
29918
  } catch (error) {
29860
29919
  throw new BadRequestError117("Invalid patrol log transaction ID format.");
29861
29920
  }
@@ -29874,7 +29933,7 @@ function usePatrolLogRepo() {
29874
29933
  }
29875
29934
  async function deleteById(_id, session) {
29876
29935
  try {
29877
- _id = new ObjectId71(_id);
29936
+ _id = new ObjectId72(_id);
29878
29937
  } catch (error) {
29879
29938
  throw new BadRequestError117("Invalid patrol log ID format.");
29880
29939
  }
@@ -29888,7 +29947,7 @@ function usePatrolLogRepo() {
29888
29947
  }
29889
29948
  async function getById(_id, session) {
29890
29949
  try {
29891
- _id = new ObjectId71(_id);
29950
+ _id = new ObjectId72(_id);
29892
29951
  } catch (error) {
29893
29952
  throw new BadRequestError117("Invalid patrol log ID format.");
29894
29953
  }
@@ -30141,7 +30200,7 @@ function usePatrolLogController() {
30141
30200
 
30142
30201
  // src/models/site-facility.model.ts
30143
30202
  import Joi69 from "joi";
30144
- import { ObjectId as ObjectId72 } from "mongodb";
30203
+ import { ObjectId as ObjectId73 } from "mongodb";
30145
30204
  var timeSlotSchema = Joi69.array().items(
30146
30205
  Joi69.object({
30147
30206
  start: Joi69.string().optional().allow("", null),
@@ -30301,28 +30360,28 @@ function MSiteFacility(value) {
30301
30360
  throw new Error(error.details[0].message);
30302
30361
  if (value._id && typeof value._id === "string") {
30303
30362
  try {
30304
- value._id = new ObjectId72(value._id);
30363
+ value._id = new ObjectId73(value._id);
30305
30364
  } catch {
30306
30365
  throw new Error("Invalid _id.");
30307
30366
  }
30308
30367
  }
30309
30368
  if (value.site && typeof value.site === "string") {
30310
30369
  try {
30311
- value.site = new ObjectId72(value.site);
30370
+ value.site = new ObjectId73(value.site);
30312
30371
  } catch {
30313
30372
  throw new Error("Invalid _id.");
30314
30373
  }
30315
30374
  }
30316
30375
  if (value.featuredImage && typeof value.featuredImage === "string") {
30317
30376
  try {
30318
- value.featuredImage = new ObjectId72(value.featuredImage);
30377
+ value.featuredImage = new ObjectId73(value.featuredImage);
30319
30378
  } catch {
30320
30379
  throw new Error("Invalid featuredImage ID.");
30321
30380
  }
30322
30381
  }
30323
30382
  if (Array.isArray(value.gallery)) {
30324
30383
  try {
30325
- value.gallery = value.gallery.map((id) => new ObjectId72(id));
30384
+ value.gallery = value.gallery.map((id) => new ObjectId73(id));
30326
30385
  } catch {
30327
30386
  throw new Error("Invalid ID in gallery array.");
30328
30387
  }
@@ -30415,7 +30474,7 @@ import {
30415
30474
  useAtlas as useAtlas59,
30416
30475
  useCache as useCache38
30417
30476
  } from "@7365admin1/node-server-utils";
30418
- import { ObjectId as ObjectId73 } from "mongodb";
30477
+ import { ObjectId as ObjectId74 } from "mongodb";
30419
30478
  function useSiteFacilityRepo() {
30420
30479
  const db = useAtlas59.getDb();
30421
30480
  if (!db) {
@@ -30483,7 +30542,7 @@ function useSiteFacilityRepo() {
30483
30542
  };
30484
30543
  if (site) {
30485
30544
  try {
30486
- site = new ObjectId73(site);
30545
+ site = new ObjectId74(site);
30487
30546
  query.site = site;
30488
30547
  cacheOptions.site = site.toString();
30489
30548
  } catch (error) {
@@ -30528,7 +30587,7 @@ function useSiteFacilityRepo() {
30528
30587
  }
30529
30588
  async function getSiteFacilityById(_id, session) {
30530
30589
  try {
30531
- _id = new ObjectId73(_id);
30590
+ _id = new ObjectId74(_id);
30532
30591
  } catch (error) {
30533
30592
  throw new BadRequestError120("Invalid site facility ID format.");
30534
30593
  }
@@ -30556,20 +30615,20 @@ function useSiteFacilityRepo() {
30556
30615
  async function updateSiteFacilityById(_id, value, session) {
30557
30616
  value.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
30558
30617
  try {
30559
- _id = new ObjectId73(_id);
30618
+ _id = new ObjectId74(_id);
30560
30619
  } catch (error) {
30561
30620
  throw new BadRequestError120("Invalid ID format.");
30562
30621
  }
30563
30622
  if (value.featuredImage) {
30564
30623
  try {
30565
- value.featuredImage = new ObjectId73(value.featuredImage);
30624
+ value.featuredImage = new ObjectId74(value.featuredImage);
30566
30625
  } catch (error) {
30567
30626
  throw new BadRequestError120("Invalid ID format for featured image.");
30568
30627
  }
30569
30628
  }
30570
30629
  if (Array.isArray(value.gallery)) {
30571
30630
  try {
30572
- value.gallery = value.gallery.map((id) => new ObjectId73(id));
30631
+ value.gallery = value.gallery.map((id) => new ObjectId74(id));
30573
30632
  } catch {
30574
30633
  throw new Error("Invalid ID in gallery array.");
30575
30634
  }
@@ -30615,7 +30674,7 @@ function useSiteFacilityRepo() {
30615
30674
  }
30616
30675
  async function deleteSiteFacilityById(_id) {
30617
30676
  try {
30618
- _id = new ObjectId73(_id);
30677
+ _id = new ObjectId74(_id);
30619
30678
  } catch (error) {
30620
30679
  throw new BadRequestError120("Invalid site facility ID format.");
30621
30680
  }
@@ -30644,12 +30703,12 @@ function useSiteFacilityRepo() {
30644
30703
  }
30645
30704
  async function getSiteFacilityTimeSlotById(_id, site, session) {
30646
30705
  try {
30647
- _id = new ObjectId73(_id);
30706
+ _id = new ObjectId74(_id);
30648
30707
  } catch (error) {
30649
30708
  throw new BadRequestError120("Invalid facility ID format.");
30650
30709
  }
30651
30710
  try {
30652
- site = new ObjectId73(site);
30711
+ site = new ObjectId74(site);
30653
30712
  } catch (error) {
30654
30713
  throw new BadRequestError120("Invalid site ID format.");
30655
30714
  }
@@ -30992,7 +31051,7 @@ function useSiteFacilityController() {
30992
31051
 
30993
31052
  // src/models/service-provider-billing.model.ts
30994
31053
  import Joi71 from "joi";
30995
- import { ObjectId as ObjectId74 } from "mongodb";
31054
+ import { ObjectId as ObjectId75 } from "mongodb";
30996
31055
  var schemaServiceProviderBilling = Joi71.object({
30997
31056
  _id: Joi71.string().hex().optional().allow("", null),
30998
31057
  attachments: Joi71.array().items(Joi71.string().hex()).required(),
@@ -31026,7 +31085,7 @@ function MServiceProviderBilling(value) {
31026
31085
  }
31027
31086
  if (value._id && typeof value._id === "string") {
31028
31087
  try {
31029
- value._id = new ObjectId74(value._id);
31088
+ value._id = new ObjectId75(value._id);
31030
31089
  } catch {
31031
31090
  throw new Error("Invalid ID.");
31032
31091
  }
@@ -31035,7 +31094,7 @@ function MServiceProviderBilling(value) {
31035
31094
  value.acknowledgedBy = value.acknowledgedBy.map((item) => {
31036
31095
  if (item.user && typeof item.user === "string") {
31037
31096
  try {
31038
- item.user = new ObjectId74(item.user);
31097
+ item.user = new ObjectId75(item.user);
31039
31098
  } catch (error2) {
31040
31099
  throw new Error("Invalid ID format for acknowledgedBy.user.");
31041
31100
  }
@@ -31045,13 +31104,13 @@ function MServiceProviderBilling(value) {
31045
31104
  }
31046
31105
  if (value.orgId && typeof value.orgId === "string") {
31047
31106
  try {
31048
- value.orgId = new ObjectId74(value.orgId);
31107
+ value.orgId = new ObjectId75(value.orgId);
31049
31108
  } catch {
31050
31109
  throw new Error("Invalid org ID.");
31051
31110
  }
31052
31111
  }
31053
31112
  return {
31054
- _id: value._id ?? new ObjectId74(),
31113
+ _id: value._id ?? new ObjectId75(),
31055
31114
  attachments: value.attachments,
31056
31115
  acknowledgedBy: value.acknowledgedBy || [],
31057
31116
  status: value.status,
@@ -31073,7 +31132,7 @@ import {
31073
31132
  useAtlas as useAtlas61,
31074
31133
  useCache as useCache39
31075
31134
  } from "@7365admin1/node-server-utils";
31076
- import { ObjectId as ObjectId75 } from "mongodb";
31135
+ import { ObjectId as ObjectId76 } from "mongodb";
31077
31136
  function useServiceProviderBillingRepo() {
31078
31137
  const db = useAtlas61.getDb();
31079
31138
  if (!db) {
@@ -31120,7 +31179,7 @@ function useServiceProviderBillingRepo() {
31120
31179
  }, session) {
31121
31180
  page = page > 0 ? page - 1 : 0;
31122
31181
  try {
31123
- org = new ObjectId75(org);
31182
+ org = new ObjectId76(org);
31124
31183
  } catch (error) {
31125
31184
  throw new BadRequestError122("Invalid org ID format.");
31126
31185
  }
@@ -31170,7 +31229,7 @@ function useServiceProviderBillingRepo() {
31170
31229
  }
31171
31230
  async function getSiteServiceProviderBillingById(_id, session) {
31172
31231
  try {
31173
- _id = new ObjectId75(_id);
31232
+ _id = new ObjectId76(_id);
31174
31233
  } catch (error) {
31175
31234
  throw new BadRequestError122("Invalid service provider billing ID format.");
31176
31235
  }
@@ -31198,7 +31257,7 @@ function useServiceProviderBillingRepo() {
31198
31257
  async function updateServiceProviderBillingById(_id, value, session) {
31199
31258
  value.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
31200
31259
  try {
31201
- _id = new ObjectId75(_id);
31260
+ _id = new ObjectId76(_id);
31202
31261
  } catch (error) {
31203
31262
  throw new BadRequestError122("Invalid ID format.");
31204
31263
  }
@@ -31206,7 +31265,7 @@ function useServiceProviderBillingRepo() {
31206
31265
  value.acknowledgedBy = value.acknowledgedBy.map((item) => {
31207
31266
  if (item.user && typeof item.user === "string") {
31208
31267
  try {
31209
- item.user = new ObjectId75(item.user);
31268
+ item.user = new ObjectId76(item.user);
31210
31269
  } catch (error) {
31211
31270
  throw new Error("Invalid ID format for acknowledgedBy.user.");
31212
31271
  }
@@ -31240,7 +31299,7 @@ function useServiceProviderBillingRepo() {
31240
31299
  }
31241
31300
  async function deleteServiceProviderBillingById(_id) {
31242
31301
  try {
31243
- _id = new ObjectId75(_id);
31302
+ _id = new ObjectId76(_id);
31244
31303
  } catch (error) {
31245
31304
  throw new BadRequestError122("Invalid service provider billing ID format.");
31246
31305
  }
@@ -31478,7 +31537,7 @@ function useServiceProviderBillingController() {
31478
31537
 
31479
31538
  // src/models/site-facility-booking.model.ts
31480
31539
  import Joi73 from "joi";
31481
- import { ObjectId as ObjectId76 } from "mongodb";
31540
+ import { ObjectId as ObjectId77 } from "mongodb";
31482
31541
  var FacilitySort = /* @__PURE__ */ ((FacilitySort2) => {
31483
31542
  FacilitySort2["CREATED_AT"] = "createdAt";
31484
31543
  FacilitySort2["NAME"] = "name";
@@ -31588,48 +31647,48 @@ function MSiteFacilityBooking(value) {
31588
31647
  }
31589
31648
  if (value._id && typeof value._id === "string") {
31590
31649
  try {
31591
- value._id = new ObjectId76(value._id);
31650
+ value._id = new ObjectId77(value._id);
31592
31651
  } catch {
31593
31652
  throw new Error("Invalid ID.");
31594
31653
  }
31595
31654
  }
31596
31655
  if (value.site && typeof value.site === "string") {
31597
31656
  try {
31598
- value.site = new ObjectId76(value.site);
31657
+ value.site = new ObjectId77(value.site);
31599
31658
  } catch {
31600
31659
  throw new Error("Invalid site ID.");
31601
31660
  }
31602
31661
  }
31603
31662
  if (value.user && typeof value.user === "string") {
31604
31663
  try {
31605
- value.user = new ObjectId76(value.user);
31664
+ value.user = new ObjectId77(value.user);
31606
31665
  } catch {
31607
31666
  throw new Error("Invalid user ID.");
31608
31667
  }
31609
31668
  }
31610
31669
  if (value.approvedBy && typeof value.approvedBy === "string") {
31611
31670
  try {
31612
- value.approvedBy = new ObjectId76(value.approvedBy);
31671
+ value.approvedBy = new ObjectId77(value.approvedBy);
31613
31672
  } catch {
31614
31673
  throw new Error("Invalid approved by ID.");
31615
31674
  }
31616
31675
  }
31617
31676
  if (value.createdBy && typeof value.createdBy === "string") {
31618
31677
  try {
31619
- value.createdBy = new ObjectId76(value.createdBy);
31678
+ value.createdBy = new ObjectId77(value.createdBy);
31620
31679
  } catch {
31621
31680
  throw new Error("Invalid created by ID.");
31622
31681
  }
31623
31682
  }
31624
31683
  if (value.updatedBy && typeof value.updatedBy === "string") {
31625
31684
  try {
31626
- value.updatedBy = new ObjectId76(value.updatedBy);
31685
+ value.updatedBy = new ObjectId77(value.updatedBy);
31627
31686
  } catch {
31628
31687
  throw new Error("Invalid updated by ID.");
31629
31688
  }
31630
31689
  }
31631
31690
  return {
31632
- _id: value._id ?? new ObjectId76(),
31691
+ _id: value._id ?? new ObjectId77(),
31633
31692
  facility: value.facility ?? "",
31634
31693
  slot: value.slot ?? "",
31635
31694
  slotName: value.slotName ?? "",
@@ -31725,7 +31784,7 @@ import {
31725
31784
  useAtlas as useAtlas63,
31726
31785
  useCache as useCache40
31727
31786
  } from "@7365admin1/node-server-utils";
31728
- import { ObjectId as ObjectId77 } from "mongodb";
31787
+ import { ObjectId as ObjectId78 } from "mongodb";
31729
31788
  var facility_bookings_namespace_collection = "site.facilty-booking";
31730
31789
  function useSiteFacilityBookingRepo() {
31731
31790
  const db = useAtlas63.getDb();
@@ -31888,7 +31947,7 @@ function useSiteFacilityBookingRepo() {
31888
31947
  }
31889
31948
  async function deleteSiteFacilityBookingById(_id) {
31890
31949
  try {
31891
- _id = new ObjectId77(_id);
31950
+ _id = new ObjectId78(_id);
31892
31951
  } catch (error) {
31893
31952
  throw new BadRequestError124("Invalid site facility booking ID format.");
31894
31953
  }
@@ -32125,7 +32184,7 @@ function useSiteFacilityBookingController() {
32125
32184
 
32126
32185
  // src/models/document-management.model.ts
32127
32186
  import Joi75 from "joi";
32128
- import { ObjectId as ObjectId78 } from "mongodb";
32187
+ import { ObjectId as ObjectId79 } from "mongodb";
32129
32188
  var schemaDocumentManagement = Joi75.object({
32130
32189
  _id: Joi75.string().hex().optional().allow("", null),
32131
32190
  name: Joi75.string().required(),
@@ -32163,28 +32222,28 @@ function MDocumentManagement(value) {
32163
32222
  }
32164
32223
  if (value._id && typeof value._id === "string") {
32165
32224
  try {
32166
- value._id = new ObjectId78(value._id);
32225
+ value._id = new ObjectId79(value._id);
32167
32226
  } catch (error2) {
32168
32227
  throw new Error("Invalid ID.");
32169
32228
  }
32170
32229
  }
32171
32230
  if (value.org && typeof value.org === "string") {
32172
32231
  try {
32173
- value.org = new ObjectId78(value.org);
32232
+ value.org = new ObjectId79(value.org);
32174
32233
  } catch (error2) {
32175
32234
  throw new Error("Invalid org ID.");
32176
32235
  }
32177
32236
  }
32178
32237
  if (value.site && typeof value.site === "string") {
32179
32238
  try {
32180
- value.site = new ObjectId78(value.site);
32239
+ value.site = new ObjectId79(value.site);
32181
32240
  } catch (error2) {
32182
32241
  throw new Error("Invalid site ID.");
32183
32242
  }
32184
32243
  }
32185
32244
  if (value.parentId && typeof value.parentId === "string") {
32186
32245
  try {
32187
- value.parentId = new ObjectId78(value.parentId);
32246
+ value.parentId = new ObjectId79(value.parentId);
32188
32247
  } catch (error2) {
32189
32248
  throw new Error("Invalid parentId.");
32190
32249
  }
@@ -32218,7 +32277,7 @@ import {
32218
32277
  useAtlas as useAtlas65,
32219
32278
  useCache as useCache41
32220
32279
  } from "@7365admin1/node-server-utils";
32221
- import { ObjectId as ObjectId79 } from "mongodb";
32280
+ import { ObjectId as ObjectId80 } from "mongodb";
32222
32281
  function useDocumentManagementRepo() {
32223
32282
  const db = useAtlas65.getDb();
32224
32283
  if (!db) {
@@ -32280,7 +32339,7 @@ function useDocumentManagementRepo() {
32280
32339
  }) {
32281
32340
  page = page > 0 ? page - 1 : 0;
32282
32341
  try {
32283
- site = new ObjectId79(site);
32342
+ site = new ObjectId80(site);
32284
32343
  } catch (error) {
32285
32344
  throw new BadRequestError126("Invalid site ID format.");
32286
32345
  }
@@ -32297,12 +32356,12 @@ function useDocumentManagementRepo() {
32297
32356
  cacheOptions.type = type;
32298
32357
  }
32299
32358
  if (org) {
32300
- query.org = new ObjectId79(org);
32359
+ query.org = new ObjectId80(org);
32301
32360
  cacheOptions.org = org.toString();
32302
32361
  }
32303
32362
  if (parentId) {
32304
32363
  try {
32305
- query.parentId = new ObjectId79(parentId);
32364
+ query.parentId = new ObjectId80(parentId);
32306
32365
  cacheOptions.parentId = parentId.toString();
32307
32366
  } catch (error) {
32308
32367
  throw new BadRequestError126("Invalid parentId format.");
@@ -32356,7 +32415,7 @@ function useDocumentManagementRepo() {
32356
32415
  }
32357
32416
  async function getDocumentById(_id) {
32358
32417
  try {
32359
- _id = new ObjectId79(_id);
32418
+ _id = new ObjectId80(_id);
32360
32419
  } catch (error) {
32361
32420
  throw new BadRequestError126("Invalid document ID format.");
32362
32421
  }
@@ -32401,7 +32460,7 @@ function useDocumentManagementRepo() {
32401
32460
  }
32402
32461
  async function updateDocumentById(_id, value) {
32403
32462
  try {
32404
- _id = new ObjectId79(_id);
32463
+ _id = new ObjectId80(_id);
32405
32464
  } catch (error) {
32406
32465
  throw new BadRequestError126("Invalid document ID format.");
32407
32466
  }
@@ -32429,7 +32488,7 @@ function useDocumentManagementRepo() {
32429
32488
  }
32430
32489
  async function deleteDocumentById(_id, session) {
32431
32490
  try {
32432
- _id = new ObjectId79(_id);
32491
+ _id = new ObjectId80(_id);
32433
32492
  } catch (error) {
32434
32493
  throw new BadRequestError126("Invalid document ID format.");
32435
32494
  }
@@ -32462,7 +32521,7 @@ function useDocumentManagementRepo() {
32462
32521
  }
32463
32522
  async function getDocumentManagementBySiteId(site, type) {
32464
32523
  try {
32465
- site = new ObjectId79(site);
32524
+ site = new ObjectId80(site);
32466
32525
  } catch (error) {
32467
32526
  throw new BadRequestError126("Invalid document management site ID format.");
32468
32527
  }
@@ -32792,7 +32851,7 @@ function useDocumentManagementController() {
32792
32851
 
32793
32852
  // src/models/bulletin-board.model.ts
32794
32853
  import Joi77 from "joi";
32795
- import { ObjectId as ObjectId80 } from "mongodb";
32854
+ import { ObjectId as ObjectId81 } from "mongodb";
32796
32855
  var BulletinRecipient = /* @__PURE__ */ ((BulletinRecipient2) => {
32797
32856
  BulletinRecipient2["RESIDENT"] = "resident";
32798
32857
  BulletinRecipient2["SECURITY_AGENCY"] = "security_agency";
@@ -32872,21 +32931,21 @@ function MBulletinBoard(value) {
32872
32931
  }
32873
32932
  if (value._id && typeof value._id === "string") {
32874
32933
  try {
32875
- value._id = new ObjectId80(value._id);
32934
+ value._id = new ObjectId81(value._id);
32876
32935
  } catch {
32877
32936
  throw new Error("Invalid ID.");
32878
32937
  }
32879
32938
  }
32880
32939
  if (value.site && typeof value.site === "string") {
32881
32940
  try {
32882
- value.site = new ObjectId80(value.site);
32941
+ value.site = new ObjectId81(value.site);
32883
32942
  } catch {
32884
32943
  throw new Error("Invalid site ID.");
32885
32944
  }
32886
32945
  }
32887
32946
  if (value.orgId && typeof value.orgId === "string") {
32888
32947
  try {
32889
- value.orgId = new ObjectId80(value.orgId);
32948
+ value.orgId = new ObjectId81(value.orgId);
32890
32949
  } catch {
32891
32950
  throw new Error("Invalid org ID.");
32892
32951
  }
@@ -32895,7 +32954,7 @@ function MBulletinBoard(value) {
32895
32954
  value.file = value.file.map((f) => {
32896
32955
  if (f._id && typeof f._id === "string") {
32897
32956
  try {
32898
- return { ...f, _id: new ObjectId80(f._id) };
32957
+ return { ...f, _id: new ObjectId81(f._id) };
32899
32958
  } catch {
32900
32959
  throw new Error("Invalid file ID.");
32901
32960
  }
@@ -32904,7 +32963,7 @@ function MBulletinBoard(value) {
32904
32963
  });
32905
32964
  }
32906
32965
  return {
32907
- _id: value._id ?? new ObjectId80(),
32966
+ _id: value._id ?? new ObjectId81(),
32908
32967
  site: value.site ?? "",
32909
32968
  orgId: value.orgId ?? "",
32910
32969
  recipients: value.recipients ?? [],
@@ -32932,7 +32991,7 @@ import {
32932
32991
  useAtlas as useAtlas67,
32933
32992
  useCache as useCache42
32934
32993
  } from "@7365admin1/node-server-utils";
32935
- import { ObjectId as ObjectId81 } from "mongodb";
32994
+ import { ObjectId as ObjectId82 } from "mongodb";
32936
32995
  var bulletin_boards_namespace_collection = "bulletin-boards";
32937
32996
  function useBulletinBoardRepo() {
32938
32997
  const db = useAtlas67.getDb();
@@ -32985,7 +33044,7 @@ function useBulletinBoardRepo() {
32985
33044
  }, session) {
32986
33045
  page = page > 0 ? page - 1 : 0;
32987
33046
  try {
32988
- site = new ObjectId81(site);
33047
+ site = new ObjectId82(site);
32989
33048
  } catch (error) {
32990
33049
  throw new BadRequestError129("Invalid site ID format.");
32991
33050
  }
@@ -33044,7 +33103,7 @@ function useBulletinBoardRepo() {
33044
33103
  }
33045
33104
  async function getBulletinBoardById(_id, session) {
33046
33105
  try {
33047
- _id = new ObjectId81(_id);
33106
+ _id = new ObjectId82(_id);
33048
33107
  } catch (error) {
33049
33108
  throw new BadRequestError129("Invalid bulletin board ID format.");
33050
33109
  }
@@ -33074,13 +33133,13 @@ function useBulletinBoardRepo() {
33074
33133
  async function updateBulletinBoardById(_id, value, session) {
33075
33134
  value.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
33076
33135
  try {
33077
- _id = new ObjectId81(_id);
33136
+ _id = new ObjectId82(_id);
33078
33137
  } catch (error) {
33079
33138
  throw new BadRequestError129("Invalid ID format.");
33080
33139
  }
33081
33140
  if (value.site && typeof value.site === "string") {
33082
33141
  try {
33083
- value.site = new ObjectId81(value.site);
33142
+ value.site = new ObjectId82(value.site);
33084
33143
  } catch {
33085
33144
  throw new Error("Invalid site ID.");
33086
33145
  }
@@ -33111,7 +33170,7 @@ function useBulletinBoardRepo() {
33111
33170
  }
33112
33171
  async function deleteBulletinBoardById(_id, session) {
33113
33172
  try {
33114
- _id = new ObjectId81(_id);
33173
+ _id = new ObjectId82(_id);
33115
33174
  } catch (error) {
33116
33175
  throw new BadRequestError129("Invalid bulletin board ID format.");
33117
33176
  }
@@ -33545,7 +33604,7 @@ function useBulletinBoardController() {
33545
33604
 
33546
33605
  // src/models/site-billing-item.model.ts
33547
33606
  import { BadRequestError as BadRequestError131, logger as logger109 } from "@7365admin1/node-server-utils";
33548
- import { ObjectId as ObjectId82 } from "mongodb";
33607
+ import { ObjectId as ObjectId83 } from "mongodb";
33549
33608
  import Joi79 from "joi";
33550
33609
 
33551
33610
  // src/types/enums/billing-frequency.enum.ts
@@ -33616,21 +33675,21 @@ function MBillingItem(value) {
33616
33675
  }
33617
33676
  if (value._id && typeof value._id === "string") {
33618
33677
  try {
33619
- value._id = new ObjectId82(value._id);
33678
+ value._id = new ObjectId83(value._id);
33620
33679
  } catch {
33621
33680
  throw new BadRequestError131("Invalid _id format");
33622
33681
  }
33623
33682
  }
33624
33683
  if (value.site && typeof value.site === "string") {
33625
33684
  try {
33626
- value.site = new ObjectId82(value.site);
33685
+ value.site = new ObjectId83(value.site);
33627
33686
  } catch {
33628
33687
  throw new BadRequestError131("Invalid site id format");
33629
33688
  }
33630
33689
  }
33631
33690
  if (value.org && typeof value.org === "string") {
33632
33691
  try {
33633
- value.org = new ObjectId82(value.org);
33692
+ value.org = new ObjectId83(value.org);
33634
33693
  } catch {
33635
33694
  throw new BadRequestError131("Invalid org id format");
33636
33695
  }
@@ -33639,7 +33698,7 @@ function MBillingItem(value) {
33639
33698
  value.units = value.units.map((unit) => {
33640
33699
  if (unit._id && typeof unit._id === "string") {
33641
33700
  try {
33642
- unit._id = new ObjectId82(unit._id);
33701
+ unit._id = new ObjectId83(unit._id);
33643
33702
  } catch {
33644
33703
  throw new BadRequestError131("Invalid unit id format");
33645
33704
  }
@@ -33648,7 +33707,7 @@ function MBillingItem(value) {
33648
33707
  });
33649
33708
  }
33650
33709
  return {
33651
- _id: value._id ?? new ObjectId82(),
33710
+ _id: value._id ?? new ObjectId83(),
33652
33711
  site: value.site,
33653
33712
  org: value.org,
33654
33713
  name: value.name,
@@ -33685,7 +33744,7 @@ import {
33685
33744
  paginate as paginate36,
33686
33745
  makeCacheKey as makeCacheKey41
33687
33746
  } from "@7365admin1/node-server-utils";
33688
- import { ObjectId as ObjectId83 } from "mongodb";
33747
+ import { ObjectId as ObjectId84 } from "mongodb";
33689
33748
  function useSiteBillingItemRepo() {
33690
33749
  const db = useAtlas69.getDb();
33691
33750
  if (!db) {
@@ -33772,7 +33831,7 @@ function useSiteBillingItemRepo() {
33772
33831
  }
33773
33832
  ]
33774
33833
  },
33775
- ...ObjectId83.isValid(site) && { site: new ObjectId83(site) }
33834
+ ...ObjectId84.isValid(site) && { site: new ObjectId84(site) }
33776
33835
  };
33777
33836
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
33778
33837
  const cacheOptions = {
@@ -33812,7 +33871,7 @@ function useSiteBillingItemRepo() {
33812
33871
  }
33813
33872
  async function getById(_id, session) {
33814
33873
  try {
33815
- _id = new ObjectId83(_id);
33874
+ _id = new ObjectId84(_id);
33816
33875
  } catch (error) {
33817
33876
  throw new BadRequestError132("Invalid ID.");
33818
33877
  }
@@ -33851,22 +33910,22 @@ function useSiteBillingItemRepo() {
33851
33910
  }
33852
33911
  async function updateById(_id, value, session) {
33853
33912
  try {
33854
- _id = new ObjectId83(_id);
33913
+ _id = new ObjectId84(_id);
33855
33914
  } catch (error) {
33856
33915
  throw new BadRequestError132(
33857
33916
  "Invalid site billing item transaction ID format."
33858
33917
  );
33859
33918
  }
33860
- if (value.site && ObjectId83.isValid(value.site.toString())) {
33919
+ if (value.site && ObjectId84.isValid(value.site.toString())) {
33861
33920
  try {
33862
- value.site = new ObjectId83(value.site.toString());
33921
+ value.site = new ObjectId84(value.site.toString());
33863
33922
  } catch {
33864
33923
  throw new BadRequestError132("Invalid _id format");
33865
33924
  }
33866
33925
  }
33867
- if (value.org && ObjectId83.isValid(value.org.toString())) {
33926
+ if (value.org && ObjectId84.isValid(value.org.toString())) {
33868
33927
  try {
33869
- value.org = new ObjectId83(value.org.toString());
33928
+ value.org = new ObjectId84(value.org.toString());
33870
33929
  } catch {
33871
33930
  throw new BadRequestError132("Invalid _id format");
33872
33931
  }
@@ -33886,7 +33945,7 @@ function useSiteBillingItemRepo() {
33886
33945
  }
33887
33946
  async function deleteById(_id) {
33888
33947
  try {
33889
- _id = new ObjectId83(_id);
33948
+ _id = new ObjectId84(_id);
33890
33949
  } catch (error) {
33891
33950
  throw new BadRequestError132(
33892
33951
  "Invalid site billing item transaction ID format."
@@ -33956,7 +34015,7 @@ import {
33956
34015
 
33957
34016
  // src/models/site-billing-configuration.model.ts
33958
34017
  import { BadRequestError as BadRequestError133, logger as logger111 } from "@7365admin1/node-server-utils";
33959
- import { ObjectId as ObjectId84 } from "mongodb";
34018
+ import { ObjectId as ObjectId85 } from "mongodb";
33960
34019
  import Joi80 from "joi";
33961
34020
  var schemaBillingConfiguration = Joi80.object({
33962
34021
  _id: Joi80.string().hex().optional(),
@@ -34017,34 +34076,34 @@ function MBillingConfiguration(value) {
34017
34076
  }
34018
34077
  if (value._id && typeof value._id === "string") {
34019
34078
  try {
34020
- value._id = new ObjectId84(value._id);
34079
+ value._id = new ObjectId85(value._id);
34021
34080
  } catch {
34022
34081
  throw new BadRequestError133("Invalid _id format");
34023
34082
  }
34024
34083
  }
34025
34084
  if (value.site && typeof value.site === "string") {
34026
34085
  try {
34027
- value.site = new ObjectId84(value.site);
34086
+ value.site = new ObjectId85(value.site);
34028
34087
  } catch {
34029
34088
  throw new BadRequestError133("Invalid site id format");
34030
34089
  }
34031
34090
  }
34032
34091
  if (value.org && typeof value.org === "string") {
34033
34092
  try {
34034
- value.org = new ObjectId84(value.org);
34093
+ value.org = new ObjectId85(value.org);
34035
34094
  } catch {
34036
34095
  throw new BadRequestError133("Invalid org id format");
34037
34096
  }
34038
34097
  }
34039
34098
  if (value.createdBy && typeof value.createdBy === "string") {
34040
34099
  try {
34041
- value.createdBy = new ObjectId84(value.createdBy);
34100
+ value.createdBy = new ObjectId85(value.createdBy);
34042
34101
  } catch {
34043
34102
  throw new BadRequestError133("Invalid createdBy id format");
34044
34103
  }
34045
34104
  }
34046
34105
  return {
34047
- _id: value._id ?? new ObjectId84(),
34106
+ _id: value._id ?? new ObjectId85(),
34048
34107
  site: value.site,
34049
34108
  org: value.org,
34050
34109
  siteName: value.siteName,
@@ -34073,7 +34132,7 @@ function MBillingConfiguration(value) {
34073
34132
  }
34074
34133
 
34075
34134
  // src/repositories/site-billing-configuration.repo.ts
34076
- import { ObjectId as ObjectId85 } from "mongodb";
34135
+ import { ObjectId as ObjectId86 } from "mongodb";
34077
34136
  function useSiteBillingConfigurationRepo() {
34078
34137
  const db = useAtlas70.getDb();
34079
34138
  if (!db) {
@@ -34146,7 +34205,7 @@ function useSiteBillingConfigurationRepo() {
34146
34205
  const query = {
34147
34206
  status,
34148
34207
  ...search && { $text: { $search: search } },
34149
- ...ObjectId85.isValid(site) && { site: new ObjectId85(site) }
34208
+ ...ObjectId86.isValid(site) && { site: new ObjectId86(site) }
34150
34209
  };
34151
34210
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
34152
34211
  const cacheOptions = {
@@ -34186,7 +34245,7 @@ function useSiteBillingConfigurationRepo() {
34186
34245
  }
34187
34246
  async function getById(_id) {
34188
34247
  try {
34189
- _id = new ObjectId85(_id);
34248
+ _id = new ObjectId86(_id);
34190
34249
  } catch (error) {
34191
34250
  throw new BadRequestError134("Invalid ID.");
34192
34251
  }
@@ -34227,22 +34286,22 @@ function useSiteBillingConfigurationRepo() {
34227
34286
  }
34228
34287
  async function updateById(_id, value, session) {
34229
34288
  try {
34230
- _id = new ObjectId85(_id);
34289
+ _id = new ObjectId86(_id);
34231
34290
  } catch (error) {
34232
34291
  throw new BadRequestError134(
34233
34292
  "Invalid site billing configuration transaction ID format."
34234
34293
  );
34235
34294
  }
34236
- if (value.site && ObjectId85.isValid(value.site.toString())) {
34295
+ if (value.site && ObjectId86.isValid(value.site.toString())) {
34237
34296
  try {
34238
- value.site = new ObjectId85(value.site.toString());
34297
+ value.site = new ObjectId86(value.site.toString());
34239
34298
  } catch {
34240
34299
  throw new BadRequestError134("Invalid _id format");
34241
34300
  }
34242
34301
  }
34243
- if (value.org && ObjectId85.isValid(value.org.toString())) {
34302
+ if (value.org && ObjectId86.isValid(value.org.toString())) {
34244
34303
  try {
34245
- value.org = new ObjectId85(value.org.toString());
34304
+ value.org = new ObjectId86(value.org.toString());
34246
34305
  } catch {
34247
34306
  throw new BadRequestError134("Invalid _id format");
34248
34307
  }
@@ -34262,7 +34321,7 @@ function useSiteBillingConfigurationRepo() {
34262
34321
  }
34263
34322
  async function deleteById(_id) {
34264
34323
  try {
34265
- _id = new ObjectId85(_id);
34324
+ _id = new ObjectId86(_id);
34266
34325
  } catch (error) {
34267
34326
  throw new BadRequestError134(
34268
34327
  "Invalid site billing configuration transaction ID format."
@@ -34844,7 +34903,7 @@ function useSiteBillingConfigurationController() {
34844
34903
  }
34845
34904
 
34846
34905
  // src/models/event-management.model.ts
34847
- import { ObjectId as ObjectId86 } from "mongodb";
34906
+ import { ObjectId as ObjectId87 } from "mongodb";
34848
34907
  import Joi83 from "joi";
34849
34908
  var EventStatus = /* @__PURE__ */ ((EventStatus2) => {
34850
34909
  EventStatus2["PLANNED"] = "planned";
@@ -34888,20 +34947,20 @@ var schemaUpdateEventManagement = Joi83.object({
34888
34947
  function MEventManagement(value) {
34889
34948
  if (value._id && typeof value._id === "string") {
34890
34949
  try {
34891
- value._id = new ObjectId86(value._id);
34950
+ value._id = new ObjectId87(value._id);
34892
34951
  } catch {
34893
34952
  throw new Error("Invalid ID.");
34894
34953
  }
34895
34954
  }
34896
34955
  if (value.site && typeof value.site === "string") {
34897
34956
  try {
34898
- value.site = new ObjectId86(value.site);
34957
+ value.site = new ObjectId87(value.site);
34899
34958
  } catch {
34900
34959
  throw new Error("Invalid site ID.");
34901
34960
  }
34902
34961
  }
34903
34962
  return {
34904
- _id: value._id ?? new ObjectId86(),
34963
+ _id: value._id ?? new ObjectId87(),
34905
34964
  site: value.site,
34906
34965
  title: value.title,
34907
34966
  description: value.description ?? "",
@@ -34925,7 +34984,7 @@ import {
34925
34984
  useAtlas as useAtlas73,
34926
34985
  useCache as useCache45
34927
34986
  } from "@7365admin1/node-server-utils";
34928
- import { ObjectId as ObjectId87 } from "mongodb";
34987
+ import { ObjectId as ObjectId88 } from "mongodb";
34929
34988
  var events_namespace_collection = "event-management";
34930
34989
  function useEventManagementRepo() {
34931
34990
  const db = useAtlas73.getDb();
@@ -34993,7 +35052,7 @@ function useEventManagementRepo() {
34993
35052
  }, session) {
34994
35053
  page = page > 0 ? page - 1 : 0;
34995
35054
  try {
34996
- site = new ObjectId87(site);
35055
+ site = new ObjectId88(site);
34997
35056
  } catch (error) {
34998
35057
  throw new BadRequestError139("Invalid site ID format.");
34999
35058
  }
@@ -35081,7 +35140,7 @@ function useEventManagementRepo() {
35081
35140
  }
35082
35141
  async function getEventManagementById(_id, session) {
35083
35142
  try {
35084
- _id = new ObjectId87(_id);
35143
+ _id = new ObjectId88(_id);
35085
35144
  } catch (error) {
35086
35145
  throw new BadRequestError139("Invalid event ID format.");
35087
35146
  }
@@ -35109,13 +35168,13 @@ function useEventManagementRepo() {
35109
35168
  async function updateEventManagementById(_id, value, session) {
35110
35169
  value.updatedAt = /* @__PURE__ */ new Date();
35111
35170
  try {
35112
- _id = new ObjectId87(_id);
35171
+ _id = new ObjectId88(_id);
35113
35172
  } catch (error) {
35114
35173
  throw new BadRequestError139("Invalid ID format.");
35115
35174
  }
35116
35175
  if (value.site && typeof value.site === "string") {
35117
35176
  try {
35118
- value.site = new ObjectId87(value.site);
35177
+ value.site = new ObjectId88(value.site);
35119
35178
  } catch {
35120
35179
  throw new Error("Invalid site ID.");
35121
35180
  }
@@ -35146,7 +35205,7 @@ function useEventManagementRepo() {
35146
35205
  }
35147
35206
  async function deleteEventManagementById(_id) {
35148
35207
  try {
35149
- _id = new ObjectId87(_id);
35208
+ _id = new ObjectId88(_id);
35150
35209
  } catch (error) {
35151
35210
  throw new BadRequestError139("Invalid event ID format.");
35152
35211
  }
@@ -35434,7 +35493,7 @@ function useEventManagementController() {
35434
35493
 
35435
35494
  // src/models/site-unit-billing.model.ts
35436
35495
  import { BadRequestError as BadRequestError141, logger as logger119 } from "@7365admin1/node-server-utils";
35437
- import { ObjectId as ObjectId88 } from "mongodb";
35496
+ import { ObjectId as ObjectId89 } from "mongodb";
35438
35497
  import Joi85 from "joi";
35439
35498
  var Status = /* @__PURE__ */ ((Status2) => {
35440
35499
  Status2["PENDING"] = "pending";
@@ -35529,48 +35588,48 @@ function MUnitBilling(value) {
35529
35588
  }
35530
35589
  if (value._id && typeof value._id === "string") {
35531
35590
  try {
35532
- value._id = new ObjectId88(value._id);
35591
+ value._id = new ObjectId89(value._id);
35533
35592
  } catch {
35534
35593
  throw new BadRequestError141("Invalid _id format");
35535
35594
  }
35536
35595
  }
35537
35596
  if (value.site && typeof value.site === "string") {
35538
35597
  try {
35539
- value.site = new ObjectId88(value.site);
35598
+ value.site = new ObjectId89(value.site);
35540
35599
  } catch {
35541
35600
  throw new BadRequestError141("Invalid site id format");
35542
35601
  }
35543
35602
  }
35544
35603
  if (value.org && typeof value.org === "string") {
35545
35604
  try {
35546
- value.org = new ObjectId88(value.org);
35605
+ value.org = new ObjectId89(value.org);
35547
35606
  } catch {
35548
35607
  throw new BadRequestError141("Invalid org id format");
35549
35608
  }
35550
35609
  }
35551
35610
  if (value.paidBy && typeof value.paidBy === "string") {
35552
35611
  try {
35553
- value.paidBy = new ObjectId88(value.paidBy);
35612
+ value.paidBy = new ObjectId89(value.paidBy);
35554
35613
  } catch {
35555
35614
  throw new BadRequestError141("Invalid paidBy id format");
35556
35615
  }
35557
35616
  }
35558
35617
  if (value.billItem && typeof value.billItem === "string") {
35559
35618
  try {
35560
- value.billItem = new ObjectId88(value.billItem);
35619
+ value.billItem = new ObjectId89(value.billItem);
35561
35620
  } catch {
35562
35621
  throw new BadRequestError141("Invalid billItem id format");
35563
35622
  }
35564
35623
  }
35565
35624
  if (value.unitId && typeof value.unitId === "string") {
35566
35625
  try {
35567
- value.unitId = new ObjectId88(value.unitId);
35626
+ value.unitId = new ObjectId89(value.unitId);
35568
35627
  } catch {
35569
35628
  throw new BadRequestError141("Invalid unitId id format");
35570
35629
  }
35571
35630
  }
35572
35631
  return {
35573
- _id: value._id ?? new ObjectId88(),
35632
+ _id: value._id ?? new ObjectId89(),
35574
35633
  site: value.site ?? "",
35575
35634
  org: value.org ?? "",
35576
35635
  billItem: value.billItem ?? "",
@@ -35615,7 +35674,7 @@ import {
35615
35674
  paginate as paginate39,
35616
35675
  makeCacheKey as makeCacheKey44
35617
35676
  } from "@7365admin1/node-server-utils";
35618
- import { ObjectId as ObjectId89 } from "mongodb";
35677
+ import { ObjectId as ObjectId90 } from "mongodb";
35619
35678
  function useSiteUnitBillingRepo() {
35620
35679
  const db = useAtlas75.getDb();
35621
35680
  if (!db) {
@@ -35665,7 +35724,7 @@ function useSiteUnitBillingRepo() {
35665
35724
  const res = await collection.insertOne(value, { session });
35666
35725
  const acronym = createAcronym(value.billName || "NA");
35667
35726
  const dateFormatted = formatDateString(/* @__PURE__ */ new Date());
35668
- const newId = new ObjectId89(res.insertedId).toString().slice(-6);
35727
+ const newId = new ObjectId90(res.insertedId).toString().slice(-6);
35669
35728
  const referenceNumber = `${acronym}${newId}${dateFormatted}`;
35670
35729
  await collection.updateOne(
35671
35730
  { _id: res.insertedId },
@@ -35743,7 +35802,7 @@ function useSiteUnitBillingRepo() {
35743
35802
  }
35744
35803
  ]
35745
35804
  },
35746
- ...ObjectId89.isValid(site) && { site: new ObjectId89(site) },
35805
+ ...ObjectId90.isValid(site) && { site: new ObjectId90(site) },
35747
35806
  ...dateExpr
35748
35807
  };
35749
35808
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
@@ -35809,7 +35868,7 @@ function useSiteUnitBillingRepo() {
35809
35868
  }
35810
35869
  async function getById(_id) {
35811
35870
  try {
35812
- _id = new ObjectId89(_id);
35871
+ _id = new ObjectId90(_id);
35813
35872
  } catch (error) {
35814
35873
  throw new BadRequestError142("Invalid ID.");
35815
35874
  }
@@ -35868,8 +35927,8 @@ function useSiteUnitBillingRepo() {
35868
35927
  }
35869
35928
  const query = {
35870
35929
  status,
35871
- ...unitId && ObjectId89.isValid(unitId) && { unitId: new ObjectId89(unitId) },
35872
- ...site && ObjectId89.isValid(site) && { site: new ObjectId89(site) },
35930
+ ...unitId && ObjectId90.isValid(unitId) && { unitId: new ObjectId90(unitId) },
35931
+ ...site && ObjectId90.isValid(site) && { site: new ObjectId90(site) },
35873
35932
  ...dateExpr
35874
35933
  };
35875
35934
  try {
@@ -35907,43 +35966,43 @@ function useSiteUnitBillingRepo() {
35907
35966
  }
35908
35967
  async function updateById(_id, value, session) {
35909
35968
  try {
35910
- _id = new ObjectId89(_id);
35969
+ _id = new ObjectId90(_id);
35911
35970
  } catch (error) {
35912
35971
  throw new BadRequestError142(
35913
35972
  "Invalid site unit billing transaction ID format."
35914
35973
  );
35915
35974
  }
35916
- if (value.site && ObjectId89.isValid(value.site.toString())) {
35975
+ if (value.site && ObjectId90.isValid(value.site.toString())) {
35917
35976
  try {
35918
- value.site = new ObjectId89(value.site.toString());
35977
+ value.site = new ObjectId90(value.site.toString());
35919
35978
  } catch {
35920
35979
  throw new BadRequestError142("Invalid _id format");
35921
35980
  }
35922
35981
  }
35923
- if (value.org && ObjectId89.isValid(value.org.toString())) {
35982
+ if (value.org && ObjectId90.isValid(value.org.toString())) {
35924
35983
  try {
35925
- value.org = new ObjectId89(value.org.toString());
35984
+ value.org = new ObjectId90(value.org.toString());
35926
35985
  } catch {
35927
35986
  throw new BadRequestError142("Invalid _id format");
35928
35987
  }
35929
35988
  }
35930
- if (value.paidBy && ObjectId89.isValid(value.paidBy.toString())) {
35989
+ if (value.paidBy && ObjectId90.isValid(value.paidBy.toString())) {
35931
35990
  try {
35932
- value.org = new ObjectId89(value.paidBy.toString());
35991
+ value.org = new ObjectId90(value.paidBy.toString());
35933
35992
  } catch {
35934
35993
  throw new BadRequestError142("Invalid _id format");
35935
35994
  }
35936
35995
  }
35937
- if (value.billItem && ObjectId89.isValid(value.billItem.toString())) {
35996
+ if (value.billItem && ObjectId90.isValid(value.billItem.toString())) {
35938
35997
  try {
35939
- value.billItem = new ObjectId89(value.billItem.toString());
35998
+ value.billItem = new ObjectId90(value.billItem.toString());
35940
35999
  } catch {
35941
36000
  throw new BadRequestError142("Invalid _id format");
35942
36001
  }
35943
36002
  }
35944
- if (value.unitId && ObjectId89.isValid(value.unitId.toString())) {
36003
+ if (value.unitId && ObjectId90.isValid(value.unitId.toString())) {
35945
36004
  try {
35946
- value.unitId = new ObjectId89(value.unitId.toString());
36005
+ value.unitId = new ObjectId90(value.unitId.toString());
35947
36006
  } catch {
35948
36007
  throw new BadRequestError142("Invalid _id format");
35949
36008
  }
@@ -35963,7 +36022,7 @@ function useSiteUnitBillingRepo() {
35963
36022
  }
35964
36023
  async function deleteById(_id) {
35965
36024
  try {
35966
- _id = new ObjectId89(_id);
36025
+ _id = new ObjectId90(_id);
35967
36026
  } catch (error) {
35968
36027
  throw new BadRequestError142(
35969
36028
  "Invalid site unit billing transaction ID format."
@@ -36029,9 +36088,9 @@ function useSiteUnitBillingRepo() {
36029
36088
  }
36030
36089
  ]
36031
36090
  },
36032
- ...ObjectId89.isValid(site) && { site: new ObjectId89(site) },
36091
+ ...ObjectId90.isValid(site) && { site: new ObjectId90(site) },
36033
36092
  ...dateExpr,
36034
- ...ObjectId89.isValid(unitId) && { unitId: new ObjectId89(unitId) }
36093
+ ...ObjectId90.isValid(unitId) && { unitId: new ObjectId90(unitId) }
36035
36094
  };
36036
36095
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
36037
36096
  try {
@@ -36118,9 +36177,9 @@ function useSiteUnitBillingRepo() {
36118
36177
  }
36119
36178
  ]
36120
36179
  },
36121
- ...ObjectId89.isValid(site) && { site: new ObjectId89(site) },
36180
+ ...ObjectId90.isValid(site) && { site: new ObjectId90(site) },
36122
36181
  ...dateExpr,
36123
- ...ObjectId89.isValid(unitId) && { unitId: new ObjectId89(unitId) }
36182
+ ...ObjectId90.isValid(unitId) && { unitId: new ObjectId90(unitId) }
36124
36183
  };
36125
36184
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
36126
36185
  try {
@@ -36207,7 +36266,7 @@ import {
36207
36266
  logger as logger121,
36208
36267
  useAtlas as useAtlas76
36209
36268
  } from "@7365admin1/node-server-utils";
36210
- import { ObjectId as ObjectId90 } from "mongodb";
36269
+ import { ObjectId as ObjectId91 } from "mongodb";
36211
36270
  function useSiteUnitBillingService() {
36212
36271
  const {
36213
36272
  add: _add,
@@ -36364,7 +36423,7 @@ function useSiteUnitBillingService() {
36364
36423
  return unitsWithOwner || [];
36365
36424
  } else {
36366
36425
  if (units && units.length > 0) {
36367
- const unitIds = units.map((unit) => new ObjectId90(unit._id));
36426
+ const unitIds = units.map((unit) => new ObjectId91(unit._id));
36368
36427
  const specificUnitsWithOwner = await _getBuildingUnitsWithOwner(
36369
36428
  site || "",
36370
36429
  unitIds
@@ -36645,7 +36704,7 @@ function useSiteUnitBillingController() {
36645
36704
  }
36646
36705
 
36647
36706
  // src/models/access-management.model.ts
36648
- import { ObjectId as ObjectId91 } from "mongodb";
36707
+ import { ObjectId as ObjectId92 } from "mongodb";
36649
36708
  var EAccessCardTypes = /* @__PURE__ */ ((EAccessCardTypes2) => {
36650
36709
  EAccessCardTypes2["NFC"] = "NFC";
36651
36710
  EAccessCardTypes2["QR"] = "QRCODE";
@@ -36667,7 +36726,7 @@ var AccessTypeProps = /* @__PURE__ */ ((AccessTypeProps2) => {
36667
36726
  })(AccessTypeProps || {});
36668
36727
  var MAccessCardTransaction = class {
36669
36728
  constructor({
36670
- _id = new ObjectId91(),
36729
+ _id = new ObjectId92(),
36671
36730
  index,
36672
36731
  site,
36673
36732
  cardNo,
@@ -36694,7 +36753,7 @@ var MAccessCardTransaction = class {
36694
36753
  };
36695
36754
  var MAccessCard = class {
36696
36755
  constructor({
36697
- _id = new ObjectId91(),
36756
+ _id = new ObjectId92(),
36698
36757
  userId,
36699
36758
  site,
36700
36759
  staffNo = null,
@@ -36756,7 +36815,7 @@ import {
36756
36815
  paginate as paginate40,
36757
36816
  useAtlas as useAtlas77
36758
36817
  } from "@7365admin1/node-server-utils";
36759
- import { ObjectId as ObjectId92 } from "mongodb";
36818
+ import { ObjectId as ObjectId93 } from "mongodb";
36760
36819
 
36761
36820
  // src/utils/access-management.ts
36762
36821
  import fs3 from "fs";
@@ -37066,12 +37125,12 @@ function UseAccessManagementRepo() {
37066
37125
  payload
37067
37126
  }) {
37068
37127
  try {
37069
- payload.site = new ObjectId92(payload.site);
37128
+ payload.site = new ObjectId93(payload.site);
37070
37129
  payload.startDate = new Date(payload.startDate);
37071
37130
  payload.endDate = new Date(payload.endDate);
37072
37131
  payload.createdAt = new Date(payload.createdAt);
37073
37132
  payload.updatedAt = new Date(payload.updatedAt);
37074
- payload.assignedUnit = payload.unit?.map((id) => new ObjectId92(id));
37133
+ payload.assignedUnit = payload.unit?.map((id) => new ObjectId93(id));
37075
37134
  delete payload.unit;
37076
37135
  const accessCardObj = new MAccessCard(payload);
37077
37136
  const result = await collection().insertOne(accessCardObj);
@@ -37110,7 +37169,7 @@ function UseAccessManagementRepo() {
37110
37169
  async function addNonPhysicalCardRepo(params) {
37111
37170
  try {
37112
37171
  const MAX_RETRIES = 3;
37113
- const site = new ObjectId92(params.site);
37172
+ const site = new ObjectId93(params.site);
37114
37173
  const date = /* @__PURE__ */ new Date();
37115
37174
  const endDate = new Date(date.setFullYear(date.getFullYear() + 10));
37116
37175
  const countPerUnit = params.quantity;
@@ -37142,7 +37201,7 @@ function UseAccessManagementRepo() {
37142
37201
  userType: params.userType,
37143
37202
  doorName: params.doorName,
37144
37203
  liftName: params.liftName,
37145
- assignedUnit: new ObjectId92(units[i]),
37204
+ assignedUnit: new ObjectId93(units[i]),
37146
37205
  createdAt: new Date(params.createdAt),
37147
37206
  updatedAt: new Date(params.updatedAt),
37148
37207
  isWinsland: params.isWinsland
@@ -37228,7 +37287,7 @@ function UseAccessManagementRepo() {
37228
37287
  }
37229
37288
  async function accessManagementSettingsRepo(params) {
37230
37289
  try {
37231
- params.site = new ObjectId92(params.site);
37290
+ params.site = new ObjectId93(params.site);
37232
37291
  const result = collectionName("entrypass-settings").updateOne(
37233
37292
  { site: params.site },
37234
37293
  {
@@ -37250,7 +37309,7 @@ function UseAccessManagementRepo() {
37250
37309
  }
37251
37310
  async function allAccessCardsCountsRepo(params) {
37252
37311
  try {
37253
- const site = new ObjectId92(params.site);
37312
+ const site = new ObjectId93(params.site);
37254
37313
  const userType = params.userType;
37255
37314
  const result = await collection().aggregate([
37256
37315
  {
@@ -37310,7 +37369,7 @@ function UseAccessManagementRepo() {
37310
37369
  }
37311
37370
  async function availableAccessCardsRepo(params) {
37312
37371
  try {
37313
- const site = new ObjectId92(params.site);
37372
+ const site = new ObjectId93(params.site);
37314
37373
  const userType = params.userType;
37315
37374
  const type = params.type;
37316
37375
  const query = {
@@ -37425,7 +37484,7 @@ function UseAccessManagementRepo() {
37425
37484
  }
37426
37485
  async function userTypeAccessCardsRepo(params) {
37427
37486
  try {
37428
- const site = new ObjectId92(params.site);
37487
+ const site = new ObjectId93(params.site);
37429
37488
  const userType = params.userType;
37430
37489
  const page = params.page ? Number(params.page) - 1 : 0;
37431
37490
  const limit = Number(params.limit) || 10;
@@ -37824,7 +37883,7 @@ function UseAccessManagementRepo() {
37824
37883
  }
37825
37884
  async function assignedAccessCardsRepo(params) {
37826
37885
  try {
37827
- const site = new ObjectId92(params.site);
37886
+ const site = new ObjectId93(params.site);
37828
37887
  const userType = params.userType;
37829
37888
  const type = params.type;
37830
37889
  const search = params.search;
@@ -37999,12 +38058,12 @@ function UseAccessManagementRepo() {
37999
38058
  session?.startTransaction();
38000
38059
  const { userId, cardId, site } = params;
38001
38060
  const allUserId = await Promise.all(
38002
- userId.map(async (id) => new ObjectId92(id))
38061
+ userId.map(async (id) => new ObjectId93(id))
38003
38062
  );
38004
38063
  const allCardId = await Promise.all(
38005
- cardId.map(async (id) => new ObjectId92(id))
38064
+ cardId.map(async (id) => new ObjectId93(id))
38006
38065
  );
38007
- const siteId = new ObjectId92(site);
38066
+ const siteId = new ObjectId93(site);
38008
38067
  const result = await collection().updateMany(
38009
38068
  {
38010
38069
  $or: [
@@ -38035,7 +38094,7 @@ function UseAccessManagementRepo() {
38035
38094
  async function accessandLiftCardsRepo(params) {
38036
38095
  try {
38037
38096
  const { accessLevel, liftAccessLevel, site, userType, type } = params;
38038
- const siteId = new ObjectId92(site);
38097
+ const siteId = new ObjectId93(site);
38039
38098
  const query = {
38040
38099
  site: { $in: [siteId] },
38041
38100
  userType,
@@ -38068,9 +38127,9 @@ function UseAccessManagementRepo() {
38068
38127
  const session = useAtlas77.getClient()?.startSession();
38069
38128
  try {
38070
38129
  session?.startTransaction();
38071
- const siteId = new ObjectId92(params.site);
38072
- const userId = new ObjectId92(params.userId);
38073
- const cardId = new ObjectId92(params.cardId);
38130
+ const siteId = new ObjectId93(params.site);
38131
+ const userId = new ObjectId93(params.userId);
38132
+ const cardId = new ObjectId93(params.cardId);
38074
38133
  const quantity = 1;
38075
38134
  const cardCredentials = await collection().findOneAndUpdate(
38076
38135
  { _id: cardId },
@@ -38096,7 +38155,7 @@ function UseAccessManagementRepo() {
38096
38155
  (no) => no.toString().padStart(10, "0")
38097
38156
  );
38098
38157
  const accessCards = [];
38099
- const convertedUnits = unit.map((obj) => new ObjectId92(obj));
38158
+ const convertedUnits = unit.map((obj) => new ObjectId93(obj));
38100
38159
  for (let j = 0; j < (unit.length > 0 ? unit.length : quantity); j++) {
38101
38160
  accessCards.push(
38102
38161
  new MAccessCard({
@@ -38185,7 +38244,7 @@ function UseAccessManagementRepo() {
38185
38244
  session?.startTransaction();
38186
38245
  const results = [];
38187
38246
  for (let nfc of params.nfcList) {
38188
- nfc._id = new ObjectId92(nfc._id);
38247
+ nfc._id = new ObjectId93(nfc._id);
38189
38248
  const card = await collection().findOne({ _id: nfc._id }, { session });
38190
38249
  if (card) {
38191
38250
  const updateFields = {
@@ -38219,7 +38278,7 @@ function UseAccessManagementRepo() {
38219
38278
  async function doorAndLiftDropdownRepo(params) {
38220
38279
  try {
38221
38280
  const { site, type, userType } = params;
38222
- const id = new ObjectId92(site);
38281
+ const id = new ObjectId93(site);
38223
38282
  const res = collection().aggregate([
38224
38283
  {
38225
38284
  $match: {
@@ -38306,10 +38365,10 @@ function UseAccessManagementRepo() {
38306
38365
  const session = useAtlas77.getClient()?.startSession();
38307
38366
  try {
38308
38367
  const { cardId, remarks, issuedCardId, unitId, userId } = params;
38309
- const id = new ObjectId92(cardId);
38310
- const newCardId = new ObjectId92(issuedCardId);
38311
- const unit = new ObjectId92(unitId);
38312
- const user = new ObjectId92(userId);
38368
+ const id = new ObjectId93(cardId);
38369
+ const newCardId = new ObjectId93(issuedCardId);
38370
+ const unit = new ObjectId93(unitId);
38371
+ const user = new ObjectId93(userId);
38313
38372
  session?.startTransaction();
38314
38373
  const sessionResult = await Promise.all([
38315
38374
  await collection().findOneAndUpdate(
@@ -38342,7 +38401,7 @@ function UseAccessManagementRepo() {
38342
38401
  async function visitorAccessCardsRepo(params) {
38343
38402
  try {
38344
38403
  const page = params.page ? params.page - 1 : 0;
38345
- const siteId = new ObjectId92(params.site);
38404
+ const siteId = new ObjectId93(params.site);
38346
38405
  const search = params.search;
38347
38406
  const type = params.type;
38348
38407
  const limit = Number(params.limit);
@@ -38410,7 +38469,7 @@ function UseAccessManagementRepo() {
38410
38469
  }
38411
38470
  async function getCardReplacementRepo(params) {
38412
38471
  try {
38413
- const site = new ObjectId92(params.site);
38472
+ const site = new ObjectId93(params.site);
38414
38473
  const search = params.search;
38415
38474
  const statusFilter = params.statusFilter;
38416
38475
  const dateFrom = params.dateFrom;
@@ -38582,7 +38641,7 @@ function UseAccessManagementRepo() {
38582
38641
  async function getAccessManagementSettingsRepo(params) {
38583
38642
  try {
38584
38643
  const { site } = params;
38585
- const siteId = new ObjectId92(site);
38644
+ const siteId = new ObjectId93(site);
38586
38645
  const res = await collectionName("entrypass-settings").findOne(
38587
38646
  { site: siteId },
38588
38647
  { allowDiskUse: true }
@@ -38616,7 +38675,7 @@ function UseAccessManagementRepo() {
38616
38675
  const rawAccessGroup = item["accessGroup (value ex. Full Access, No Access)"];
38617
38676
  const accessGroup = typeof rawAccessGroup === "string" ? rawAccessGroup.split(",").map((v) => v.trim()).filter((v) => v !== "") : [];
38618
38677
  return new MAccessCard({
38619
- site: new ObjectId92(site),
38678
+ site: new ObjectId93(site),
38620
38679
  type: "NFC" /* NFC */,
38621
38680
  staffNo: null,
38622
38681
  accessLevel,
@@ -38667,8 +38726,8 @@ function UseAccessManagementRepo() {
38667
38726
  liftAccessLevel
38668
38727
  } = params;
38669
38728
  const [convertedUnits, convertedSite] = await Promise.all([
38670
- Promise.all(units.map((id) => new ObjectId92(id))),
38671
- new ObjectId92(site)
38729
+ Promise.all(units.map((id) => new ObjectId93(id))),
38730
+ new ObjectId93(site)
38672
38731
  ]);
38673
38732
  const totalRequired = quantity * convertedUnits.length;
38674
38733
  const availableCards = await collection().find({
@@ -38720,7 +38779,7 @@ function UseAccessManagementRepo() {
38720
38779
  async function deleteCardRepo(params) {
38721
38780
  try {
38722
38781
  const { cardId, remarks } = params;
38723
- const id = new ObjectId92(cardId);
38782
+ const id = new ObjectId93(cardId);
38724
38783
  const result = await collection().findOneAndUpdate(
38725
38784
  { _id: id },
38726
38785
  {
@@ -38741,8 +38800,8 @@ function UseAccessManagementRepo() {
38741
38800
  async function getCardDetailsRepo(params) {
38742
38801
  try {
38743
38802
  const { siteId, cardId } = params;
38744
- const convertedSiteId = new ObjectId92(siteId);
38745
- const convertedCardId = new ObjectId92(cardId);
38803
+ const convertedSiteId = new ObjectId93(siteId);
38804
+ const convertedCardId = new ObjectId93(cardId);
38746
38805
  const card = await collection().findOne(
38747
38806
  {
38748
38807
  _id: convertedCardId,
@@ -38791,7 +38850,7 @@ function UseAccessManagementRepo() {
38791
38850
  async function addQrTagRepo(params) {
38792
38851
  try {
38793
38852
  const { site, payload } = params;
38794
- const id = new ObjectId92(site);
38853
+ const id = new ObjectId93(site);
38795
38854
  const highestCardNo = await collection().aggregate([
38796
38855
  {
38797
38856
  $match: {
@@ -38825,7 +38884,7 @@ function UseAccessManagementRepo() {
38825
38884
  );
38826
38885
  const bulkOps = await Promise.all(
38827
38886
  payload.map(async (doc, index) => {
38828
- const id2 = new ObjectId92(doc._id);
38887
+ const id2 = new ObjectId93(doc._id);
38829
38888
  return {
38830
38889
  updateOne: {
38831
38890
  filter: { _id: id2 },
@@ -38848,7 +38907,7 @@ function UseAccessManagementRepo() {
38848
38907
  async function allQrTagRepo(params) {
38849
38908
  try {
38850
38909
  const { site } = params;
38851
- const siteId = new ObjectId92(site);
38910
+ const siteId = new ObjectId93(site);
38852
38911
  const query = {
38853
38912
  site: siteId,
38854
38913
  assignedUnit: { $ne: null },
@@ -38897,8 +38956,8 @@ function UseAccessManagementRepo() {
38897
38956
  }
38898
38957
  async function availableCardContractorsRepo(params) {
38899
38958
  try {
38900
- const siteId = new ObjectId92(params.siteId);
38901
- const unitId = new ObjectId92(params.unitId);
38959
+ const siteId = new ObjectId93(params.siteId);
38960
+ const unitId = new ObjectId93(params.unitId);
38902
38961
  const page = Number(params.page) - 1;
38903
38962
  const limit = Number(params.limit) || 10;
38904
38963
  const type = params.type;
@@ -38999,8 +39058,8 @@ function UseAccessManagementRepo() {
38999
39058
  }
39000
39059
  async function vmsgenerateQrCodesRepo(params) {
39001
39060
  try {
39002
- const site = new ObjectId92(params.site);
39003
- const unitId = new ObjectId92(params.unitId);
39061
+ const site = new ObjectId93(params.site);
39062
+ const unitId = new ObjectId93(params.unitId);
39004
39063
  const quantity = Number(params.quantity);
39005
39064
  const normalizedUnitId = params.normalizedUnitId;
39006
39065
  const date = /* @__PURE__ */ new Date();
@@ -39055,11 +39114,11 @@ function UseAccessManagementRepo() {
39055
39114
  let isAborted = false;
39056
39115
  try {
39057
39116
  await session?.startTransaction();
39058
- const siteId = new ObjectId92(params.site);
39059
- const unitId = new ObjectId92(params.unitId);
39117
+ const siteId = new ObjectId93(params.site);
39118
+ const unitId = new ObjectId93(params.unitId);
39060
39119
  const quantity = params.quantity;
39061
39120
  const type = params.type;
39062
- const visitorId = new ObjectId92(params.visitorId);
39121
+ const visitorId = new ObjectId93(params.visitorId);
39063
39122
  const nfcCards = params.nfcCards;
39064
39123
  const acm_url = params.acm_url;
39065
39124
  let cards = [];
@@ -39081,7 +39140,7 @@ function UseAccessManagementRepo() {
39081
39140
  } else if (type === "NFC" /* NFC */) {
39082
39141
  if (nfcCards && nfcCards.length > 0) {
39083
39142
  const objectIds = nfcCards.map(
39084
- (card) => new ObjectId92(card._id)
39143
+ (card) => new ObjectId93(card._id)
39085
39144
  );
39086
39145
  cards = await collection().find({ _id: { $in: objectIds } }).toArray();
39087
39146
  const nfcList = objectIds.map((card) => ({
@@ -39188,7 +39247,7 @@ function UseAccessManagementRepo() {
39188
39247
  }
39189
39248
  async function signQrCodeRepo(params) {
39190
39249
  try {
39191
- const cardId = new ObjectId92(params.cardId);
39250
+ const cardId = new ObjectId93(params.cardId);
39192
39251
  const purpose = params.purpose;
39193
39252
  let validity = 5;
39194
39253
  const card = await collection().findOne({ _id: cardId });
@@ -39213,7 +39272,7 @@ function UseAccessManagementRepo() {
39213
39272
  const session = useAtlas77.getClient()?.startSession();
39214
39273
  try {
39215
39274
  await session?.startTransaction();
39216
- const userId = new ObjectId92(params.userId);
39275
+ const userId = new ObjectId93(params.userId);
39217
39276
  const result = await collection().updateMany(
39218
39277
  { userId },
39219
39278
  { $set: { userId: null, status: "Available", updatedAt: /* @__PURE__ */ new Date() } }
@@ -39228,7 +39287,7 @@ function UseAccessManagementRepo() {
39228
39287
  }
39229
39288
  }
39230
39289
  async function getBlockLevelAndUnitListRepo(params) {
39231
- const site = new ObjectId92(params.site);
39290
+ const site = new ObjectId93(params.site);
39232
39291
  try {
39233
39292
  const blocks = await collectionName("buildings").aggregate([
39234
39293
  {
@@ -39298,7 +39357,7 @@ function UseAccessManagementRepo() {
39298
39357
  url
39299
39358
  }) {
39300
39359
  page = page ? page - 1 : 0;
39301
- site = new ObjectId92(site);
39360
+ site = new ObjectId93(site);
39302
39361
  try {
39303
39362
  let index = await collectionName("access-card-transactions").findOne(
39304
39363
  {},
@@ -39433,9 +39492,9 @@ function UseAccessManagementRepo() {
39433
39492
  throw new Error("No user to Assign.");
39434
39493
  }
39435
39494
  assignees = assignees.map(
39436
- (data) => new ObjectId92(data)
39495
+ (data) => new ObjectId93(data)
39437
39496
  );
39438
- unit = new ObjectId92(unit);
39497
+ unit = new ObjectId93(unit);
39439
39498
  let availableCards = [];
39440
39499
  let update = [];
39441
39500
  let cards = [];
@@ -39468,13 +39527,13 @@ function UseAccessManagementRepo() {
39468
39527
  throw new Error(`Not enough ${type} cards available.`);
39469
39528
  }
39470
39529
  cards = availableCards?.slice(0, assignees.length).map((card, index) => {
39471
- const userId = new ObjectId92(assignees[index].toString());
39530
+ const userId = new ObjectId93(assignees[index].toString());
39472
39531
  card.staffNo = userId.toString().slice(-10);
39473
39532
  return card;
39474
39533
  });
39475
39534
  update = availableCards.slice(0, assignees.length).map((card, index) => ({
39476
39535
  _id: card._id,
39477
- userId: new ObjectId92(assignees[index])
39536
+ userId: new ObjectId93(assignees[index])
39478
39537
  }));
39479
39538
  const commands = cards.map((item, index) => {
39480
39539
  let ag = null;
@@ -39540,7 +39599,7 @@ function UseAccessManagementRepo() {
39540
39599
  const session = useAtlas77.getClient()?.startSession();
39541
39600
  try {
39542
39601
  session?.startTransaction();
39543
- const id = new ObjectId92(userId);
39602
+ const id = new ObjectId93(userId);
39544
39603
  await collection().updateMany(
39545
39604
  { userId: id },
39546
39605
  { $set: { userId: null, status: "Available" } },
@@ -39560,8 +39619,8 @@ function UseAccessManagementRepo() {
39560
39619
  id,
39561
39620
  name
39562
39621
  }) {
39563
- site = new ObjectId92(site);
39564
- id = new ObjectId92(id);
39622
+ site = new ObjectId93(site);
39623
+ id = new ObjectId93(id);
39565
39624
  try {
39566
39625
  const result = await collectionName("sites").updateOne(
39567
39626
  { _id: site },
@@ -39578,9 +39637,9 @@ function UseAccessManagementRepo() {
39578
39637
  unitId
39579
39638
  }) {
39580
39639
  try {
39581
- orgId = new ObjectId92(orgId);
39582
- siteId = new ObjectId92(siteId);
39583
- unitId = new ObjectId92(unitId);
39640
+ orgId = new ObjectId93(orgId);
39641
+ siteId = new ObjectId93(siteId);
39642
+ unitId = new ObjectId93(unitId);
39584
39643
  const result = await collectionName("users").aggregate([
39585
39644
  {
39586
39645
  $match: {
@@ -39618,8 +39677,8 @@ function UseAccessManagementRepo() {
39618
39677
  isLiftCard
39619
39678
  }) {
39620
39679
  try {
39621
- siteId = new ObjectId92(siteId);
39622
- userId = new ObjectId92(userId);
39680
+ siteId = new ObjectId93(siteId);
39681
+ userId = new ObjectId93(userId);
39623
39682
  const query = {
39624
39683
  site: siteId,
39625
39684
  userId,
@@ -39640,7 +39699,7 @@ function UseAccessManagementRepo() {
39640
39699
  }
39641
39700
  }
39642
39701
  async function removeTemplateRepo({ site }) {
39643
- site = new ObjectId92(site);
39702
+ site = new ObjectId93(site);
39644
39703
  try {
39645
39704
  const result = await collectionName("entrypass-settings").updateOne({ _id: site }, { $set: { "settings.template": {} } });
39646
39705
  return result;
@@ -39653,8 +39712,8 @@ function UseAccessManagementRepo() {
39653
39712
  page = page ? page - 1 : 0;
39654
39713
  let defaultQuery = {};
39655
39714
  let searchQuery = {};
39656
- site = new ObjectId92(site);
39657
- userId = new ObjectId92(userId);
39715
+ site = new ObjectId93(site);
39716
+ userId = new ObjectId93(userId);
39658
39717
  if (search) {
39659
39718
  searchQuery = {
39660
39719
  $or: [{ fullName: { $regex: search, $options: "i" } }, { cardNo: { $regex: search, $options: "i" } }]
@@ -41400,7 +41459,7 @@ function useAccessManagementController() {
41400
41459
  }
41401
41460
 
41402
41461
  // src/models/nfc-patrol-tag.model.ts
41403
- import { ObjectId as ObjectId93 } from "mongodb";
41462
+ import { ObjectId as ObjectId94 } from "mongodb";
41404
41463
  import Joi88 from "joi";
41405
41464
  import { BadRequestError as BadRequestError146 } from "@7365admin1/node-server-utils";
41406
41465
  var DEVICE_STATUS = {
@@ -41427,27 +41486,27 @@ var schemaNfcPatrolTag = Joi88.object({
41427
41486
  function MNfcPatrolTag(value) {
41428
41487
  if (value._id && typeof value._id === "string") {
41429
41488
  try {
41430
- value._id = new ObjectId93(value._id);
41489
+ value._id = new ObjectId94(value._id);
41431
41490
  } catch {
41432
41491
  throw new BadRequestError146("Invalid ID.");
41433
41492
  }
41434
41493
  }
41435
41494
  if (value.site && typeof value.site === "string") {
41436
41495
  try {
41437
- value.site = new ObjectId93(value.site);
41496
+ value.site = new ObjectId94(value.site);
41438
41497
  } catch {
41439
41498
  throw new BadRequestError146("Invalid site ID.");
41440
41499
  }
41441
41500
  }
41442
41501
  if (value.createdBy && typeof value.createdBy === "string") {
41443
41502
  try {
41444
- value.createdBy = new ObjectId93(value.createdBy);
41503
+ value.createdBy = new ObjectId94(value.createdBy);
41445
41504
  } catch {
41446
41505
  throw new BadRequestError146("Invalid Created By ID.");
41447
41506
  }
41448
41507
  }
41449
41508
  return {
41450
- _id: value._id ?? new ObjectId93(),
41509
+ _id: value._id ?? new ObjectId94(),
41451
41510
  site: value.site,
41452
41511
  tagID: value.tagID,
41453
41512
  name: value.name,
@@ -41467,7 +41526,7 @@ import {
41467
41526
  useAtlas as useAtlas78,
41468
41527
  useCache as useCache48
41469
41528
  } from "@7365admin1/node-server-utils";
41470
- import { ObjectId as ObjectId94 } from "mongodb";
41529
+ import { ObjectId as ObjectId95 } from "mongodb";
41471
41530
  function useNfcPatrolTagRepo() {
41472
41531
  const db = useAtlas78.getDb();
41473
41532
  if (!db) {
@@ -41521,7 +41580,7 @@ function useNfcPatrolTagRepo() {
41521
41580
  }, session) {
41522
41581
  page = page > 0 ? page - 1 : 0;
41523
41582
  try {
41524
- site = new ObjectId94(site);
41583
+ site = new ObjectId95(site);
41525
41584
  } catch (error) {
41526
41585
  throw new BadRequestError147("Invalid site ID format.");
41527
41586
  }
@@ -41565,19 +41624,19 @@ function useNfcPatrolTagRepo() {
41565
41624
  const [updateType, findObject, setData, session] = args;
41566
41625
  if (findObject?.site && typeof findObject.site === "string") {
41567
41626
  try {
41568
- findObject.site = new ObjectId94(findObject.site);
41627
+ findObject.site = new ObjectId95(findObject.site);
41569
41628
  } catch {
41570
41629
  throw new BadRequestError147("Invalid site ID.");
41571
41630
  }
41572
41631
  }
41573
41632
  if (updateType == "Edit" && findObject?._id && typeof findObject._id === "string") {
41574
41633
  try {
41575
- findObject._id = new ObjectId94(findObject._id);
41634
+ findObject._id = new ObjectId95(findObject._id);
41576
41635
  } catch {
41577
41636
  throw new BadRequestError147("Invalid nfc patrol tag document ID.");
41578
41637
  }
41579
41638
  try {
41580
- setData.updatedBy = new ObjectId94(setData.updatedBy);
41639
+ setData.updatedBy = new ObjectId95(setData.updatedBy);
41581
41640
  } catch {
41582
41641
  throw new BadRequestError147("Invalid updatedBy ID.");
41583
41642
  }
@@ -41868,7 +41927,7 @@ function useNfcPatrolTagController() {
41868
41927
  }
41869
41928
 
41870
41929
  // src/models/occurrence-book.model.ts
41871
- import { ObjectId as ObjectId95 } from "mongodb";
41930
+ import { ObjectId as ObjectId96 } from "mongodb";
41872
41931
  import Joi90 from "joi";
41873
41932
  var DOBStatus = /* @__PURE__ */ ((DOBStatus3) => {
41874
41933
  DOBStatus3["OPEN"] = "open";
@@ -41894,20 +41953,20 @@ var schemaUpdateOccurrenceBook = Joi90.object({
41894
41953
  function MOccurrenceBook(value) {
41895
41954
  if (value._id && typeof value._id === "string") {
41896
41955
  try {
41897
- value._id = new ObjectId95(value._id);
41956
+ value._id = new ObjectId96(value._id);
41898
41957
  } catch {
41899
41958
  throw new Error("Invalid ID.");
41900
41959
  }
41901
41960
  }
41902
41961
  if (value.site && typeof value.site === "string") {
41903
41962
  try {
41904
- value.site = new ObjectId95(value.site);
41963
+ value.site = new ObjectId96(value.site);
41905
41964
  } catch {
41906
41965
  throw new Error("Invalid site ID.");
41907
41966
  }
41908
41967
  }
41909
41968
  return {
41910
- _id: value._id ?? new ObjectId95(),
41969
+ _id: value._id ?? new ObjectId96(),
41911
41970
  site: value.site,
41912
41971
  date: value.date ?? "",
41913
41972
  totalInput: value.totalInput ?? 0,
@@ -41932,7 +41991,7 @@ import {
41932
41991
  useAtlas as useAtlas80,
41933
41992
  useCache as useCache49
41934
41993
  } from "@7365admin1/node-server-utils";
41935
- import { ObjectId as ObjectId96 } from "mongodb";
41994
+ import { ObjectId as ObjectId97 } from "mongodb";
41936
41995
  var occurrence_book_namespace_collection = "occurrence-books";
41937
41996
  function useOccurrenceBookRepo() {
41938
41997
  const db = useAtlas80.getDb();
@@ -42076,7 +42135,7 @@ function useOccurrenceBookRepo() {
42076
42135
  }
42077
42136
  async function getOccurrenceBookById(_id, session) {
42078
42137
  try {
42079
- _id = new ObjectId96(_id);
42138
+ _id = new ObjectId97(_id);
42080
42139
  } catch (error) {
42081
42140
  throw new BadRequestError150("Invalid occurrence book ID format.");
42082
42141
  }
@@ -42106,7 +42165,7 @@ function useOccurrenceBookRepo() {
42106
42165
  async function updateOccurrenceBookById(_id, value, session) {
42107
42166
  value.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
42108
42167
  try {
42109
- _id = new ObjectId96(_id);
42168
+ _id = new ObjectId97(_id);
42110
42169
  } catch (error) {
42111
42170
  throw new BadRequestError150("Invalid ID format.");
42112
42171
  }
@@ -42138,7 +42197,7 @@ function useOccurrenceBookRepo() {
42138
42197
  }
42139
42198
  async function deleteOccurrenceBookById(_id) {
42140
42199
  try {
42141
- _id = new ObjectId96(_id);
42200
+ _id = new ObjectId97(_id);
42142
42201
  } catch (error) {
42143
42202
  throw new BadRequestError150("Invalid occurrence book ID format.");
42144
42203
  }
@@ -42523,7 +42582,7 @@ function useOccurrenceBookController() {
42523
42582
  }
42524
42583
 
42525
42584
  // src/models/bulletin-video.model.ts
42526
- import { ObjectId as ObjectId97 } from "mongodb";
42585
+ import { ObjectId as ObjectId98 } from "mongodb";
42527
42586
  import Joi92 from "joi";
42528
42587
  var BulletinVideoSort = /* @__PURE__ */ ((BulletinVideoSort2) => {
42529
42588
  BulletinVideoSort2["CREATED_AT"] = "createdAt";
@@ -42551,27 +42610,27 @@ var schemaUpdateBulletinVideo = Joi92.object({
42551
42610
  function MBulletinVideo(value) {
42552
42611
  if (value._id && typeof value._id === "string") {
42553
42612
  try {
42554
- value._id = new ObjectId97(value._id);
42613
+ value._id = new ObjectId98(value._id);
42555
42614
  } catch {
42556
42615
  throw new Error("Invalid ID.");
42557
42616
  }
42558
42617
  }
42559
42618
  if (value.site && typeof value.site === "string") {
42560
42619
  try {
42561
- value.site = new ObjectId97(value.site);
42620
+ value.site = new ObjectId98(value.site);
42562
42621
  } catch {
42563
42622
  throw new Error("Invalid site ID.");
42564
42623
  }
42565
42624
  }
42566
42625
  if (value.file && typeof value.file === "string") {
42567
42626
  try {
42568
- value.file = new ObjectId97(value.file);
42627
+ value.file = new ObjectId98(value.file);
42569
42628
  } catch {
42570
42629
  throw new Error("Invalid file ID.");
42571
42630
  }
42572
42631
  }
42573
42632
  return {
42574
- _id: value._id ?? new ObjectId97(),
42633
+ _id: value._id ?? new ObjectId98(),
42575
42634
  site: value.site,
42576
42635
  title: value.title ?? "",
42577
42636
  description: value.description ?? "",
@@ -42593,7 +42652,7 @@ import {
42593
42652
  useAtlas as useAtlas82,
42594
42653
  useCache as useCache50
42595
42654
  } from "@7365admin1/node-server-utils";
42596
- import { ObjectId as ObjectId98 } from "mongodb";
42655
+ import { ObjectId as ObjectId99 } from "mongodb";
42597
42656
  function useBulletinVideoRepo() {
42598
42657
  const db = useAtlas82.getDb();
42599
42658
  if (!db) {
@@ -42655,7 +42714,7 @@ function useBulletinVideoRepo() {
42655
42714
  }, session) {
42656
42715
  page = page > 0 ? page - 1 : 0;
42657
42716
  try {
42658
- site = new ObjectId98(site);
42717
+ site = new ObjectId99(site);
42659
42718
  } catch (error) {
42660
42719
  throw new BadRequestError152("Invalid site ID format.");
42661
42720
  }
@@ -42735,7 +42794,7 @@ function useBulletinVideoRepo() {
42735
42794
  }
42736
42795
  async function getBulletinVideoById(_id, session) {
42737
42796
  try {
42738
- _id = new ObjectId98(_id);
42797
+ _id = new ObjectId99(_id);
42739
42798
  } catch (error) {
42740
42799
  throw new BadRequestError152("Invalid bulletin video ID format.");
42741
42800
  }
@@ -42766,13 +42825,13 @@ function useBulletinVideoRepo() {
42766
42825
  async function updateBulletinVideoById(_id, value, session) {
42767
42826
  value.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
42768
42827
  try {
42769
- _id = new ObjectId98(_id);
42828
+ _id = new ObjectId99(_id);
42770
42829
  } catch (error) {
42771
42830
  throw new BadRequestError152("Invalid ID format.");
42772
42831
  }
42773
42832
  if (value.file && typeof value.file === "string") {
42774
42833
  try {
42775
- value.file = new ObjectId98(value.file);
42834
+ value.file = new ObjectId99(value.file);
42776
42835
  } catch {
42777
42836
  throw new Error("Invalid file ID.");
42778
42837
  }
@@ -42801,7 +42860,7 @@ function useBulletinVideoRepo() {
42801
42860
  }
42802
42861
  async function deleteBulletinVideoById(_id, session) {
42803
42862
  try {
42804
- _id = new ObjectId98(_id);
42863
+ _id = new ObjectId99(_id);
42805
42864
  } catch (error) {
42806
42865
  throw new BadRequestError152("Invalid bulletin video ID format.");
42807
42866
  }
@@ -43065,7 +43124,7 @@ function useBulletinVideoController() {
43065
43124
 
43066
43125
  // src/models/site-soa.model.ts
43067
43126
  import { BadRequestError as BadRequestError154, logger as logger130 } from "@7365admin1/node-server-utils";
43068
- import { ObjectId as ObjectId99 } from "mongodb";
43127
+ import { ObjectId as ObjectId100 } from "mongodb";
43069
43128
  import Joi94 from "joi";
43070
43129
  var schemaSOABillingItem = Joi94.object({
43071
43130
  _id: Joi94.string().required(),
@@ -43133,28 +43192,28 @@ function MStatementOfAccount(value) {
43133
43192
  }
43134
43193
  if (value._id && typeof value._id === "string") {
43135
43194
  try {
43136
- value._id = new ObjectId99(value._id);
43195
+ value._id = new ObjectId100(value._id);
43137
43196
  } catch {
43138
43197
  throw new BadRequestError154("Invalid _id format");
43139
43198
  }
43140
43199
  }
43141
43200
  if (value.site && typeof value.site === "string") {
43142
43201
  try {
43143
- value.site = new ObjectId99(value.site);
43202
+ value.site = new ObjectId100(value.site);
43144
43203
  } catch {
43145
43204
  throw new BadRequestError154("Invalid site format");
43146
43205
  }
43147
43206
  }
43148
43207
  if (value.createdBy && typeof value.createdBy === "string") {
43149
43208
  try {
43150
- value.createdBy = new ObjectId99(value.createdBy);
43209
+ value.createdBy = new ObjectId100(value.createdBy);
43151
43210
  } catch {
43152
43211
  throw new BadRequestError154("Invalid createBy format");
43153
43212
  }
43154
43213
  }
43155
43214
  if (value.unitId && typeof value.unitId === "string") {
43156
43215
  try {
43157
- value.unitId = new ObjectId99(value.unitId);
43216
+ value.unitId = new ObjectId100(value.unitId);
43158
43217
  } catch {
43159
43218
  throw new BadRequestError154("Invalid unitId format");
43160
43219
  }
@@ -43163,7 +43222,7 @@ function MStatementOfAccount(value) {
43163
43222
  value.billing = value.billing.map((bill) => {
43164
43223
  if (bill._id && typeof bill._id === "string") {
43165
43224
  try {
43166
- bill._id = new ObjectId99(bill._id);
43225
+ bill._id = new ObjectId100(bill._id);
43167
43226
  } catch {
43168
43227
  throw new BadRequestError154("Invalid billing id format");
43169
43228
  }
@@ -43172,7 +43231,7 @@ function MStatementOfAccount(value) {
43172
43231
  });
43173
43232
  }
43174
43233
  return {
43175
- _id: value._id ?? new ObjectId99(),
43234
+ _id: value._id ?? new ObjectId100(),
43176
43235
  site: value.site,
43177
43236
  unitId: value.unitId ?? "",
43178
43237
  unit: value.unit ?? "",
@@ -43204,7 +43263,7 @@ import {
43204
43263
  paginate as paginate44,
43205
43264
  makeCacheKey as makeCacheKey49
43206
43265
  } from "@7365admin1/node-server-utils";
43207
- import { ObjectId as ObjectId100 } from "mongodb";
43266
+ import { ObjectId as ObjectId101 } from "mongodb";
43208
43267
  function useStatementOfAccountRepo() {
43209
43268
  const db = useAtlas84.getDb();
43210
43269
  if (!db) {
@@ -43302,7 +43361,7 @@ function useStatementOfAccountRepo() {
43302
43361
  { category: { $regex: search, $options: "i" } }
43303
43362
  ]
43304
43363
  },
43305
- ...ObjectId100.isValid(site) && { site: new ObjectId100(site) },
43364
+ ...ObjectId101.isValid(site) && { site: new ObjectId101(site) },
43306
43365
  ...dateExpr
43307
43366
  };
43308
43367
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
@@ -43357,7 +43416,7 @@ function useStatementOfAccountRepo() {
43357
43416
  }
43358
43417
  async function getById(_id) {
43359
43418
  try {
43360
- _id = new ObjectId100(_id);
43419
+ _id = new ObjectId101(_id);
43361
43420
  } catch (error) {
43362
43421
  throw new BadRequestError155("Invalid ID.");
43363
43422
  }
@@ -43396,7 +43455,7 @@ function useStatementOfAccountRepo() {
43396
43455
  }
43397
43456
  async function updateById(_id, value, session) {
43398
43457
  try {
43399
- _id = new ObjectId100(_id);
43458
+ _id = new ObjectId101(_id);
43400
43459
  } catch (error) {
43401
43460
  throw new BadRequestError155("Invalid site SOA transaction ID format.");
43402
43461
  }
@@ -43415,7 +43474,7 @@ function useStatementOfAccountRepo() {
43415
43474
  }
43416
43475
  async function deleteById(_id) {
43417
43476
  try {
43418
- _id = new ObjectId100(_id);
43477
+ _id = new ObjectId101(_id);
43419
43478
  } catch (error) {
43420
43479
  throw new BadRequestError155("Invalid site SOA transaction ID format.");
43421
43480
  }
@@ -43437,7 +43496,7 @@ function useStatementOfAccountRepo() {
43437
43496
  }
43438
43497
  async function updateStatusById(_id, value, session) {
43439
43498
  try {
43440
- _id = new ObjectId100(_id);
43499
+ _id = new ObjectId101(_id);
43441
43500
  } catch (error) {
43442
43501
  throw new BadRequestError155("Invalid file ID format.");
43443
43502
  }
@@ -43492,9 +43551,9 @@ function useStatementOfAccountRepo() {
43492
43551
  { category: { $regex: search, $options: "i" } }
43493
43552
  ]
43494
43553
  },
43495
- ...ObjectId100.isValid(site) && { site: new ObjectId100(site) },
43554
+ ...ObjectId101.isValid(site) && { site: new ObjectId101(site) },
43496
43555
  ...dateExpr,
43497
- ...ObjectId100.isValid(unitId) && { unitId: new ObjectId100(unitId) },
43556
+ ...ObjectId101.isValid(unitId) && { unitId: new ObjectId101(unitId) },
43498
43557
  ...category && { category }
43499
43558
  };
43500
43559
  sort = Object.keys(sort).length > 0 ? sort : { _id: -1 };
@@ -43544,7 +43603,7 @@ function useStatementOfAccountRepo() {
43544
43603
  async function reviewSOA(_id, value, session) {
43545
43604
  value.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
43546
43605
  try {
43547
- _id = new ObjectId100(_id);
43606
+ _id = new ObjectId101(_id);
43548
43607
  } catch (error) {
43549
43608
  throw new BadRequestError155("Invalid ID format.");
43550
43609
  }
@@ -43593,7 +43652,7 @@ import {
43593
43652
  logger as logger132,
43594
43653
  useAtlas as useAtlas85
43595
43654
  } from "@7365admin1/node-server-utils";
43596
- import { ObjectId as ObjectId101 } from "mongodb";
43655
+ import { ObjectId as ObjectId102 } from "mongodb";
43597
43656
  import { launch } from "puppeteer";
43598
43657
  function useStatementOfAccountService() {
43599
43658
  const { add: _add, reviewSOA: _reviewSOA } = useStatementOfAccountRepo();
@@ -43730,7 +43789,7 @@ function useStatementOfAccountService() {
43730
43789
  if (!approvedBy || !approvedBy.name)
43731
43790
  throw new BadRequestError156("Created by not found.");
43732
43791
  value.approvedBy.name = approvedBy.name;
43733
- value.approvedBy._id = new ObjectId101(approvedBy._id);
43792
+ value.approvedBy._id = new ObjectId102(approvedBy._id);
43734
43793
  }
43735
43794
  await _reviewSOA(id, value, session);
43736
43795
  await session?.commitTransaction();
@@ -44112,7 +44171,7 @@ function useStatementOfAccountController() {
44112
44171
 
44113
44172
  // src/models/site-entrypass-settings.model.ts
44114
44173
  import { BadRequestError as BadRequestError158, logger as logger134 } from "@7365admin1/node-server-utils";
44115
- import { ObjectId as ObjectId102 } from "mongodb";
44174
+ import { ObjectId as ObjectId103 } from "mongodb";
44116
44175
  import Joi96 from "joi";
44117
44176
  var schemaEntryPassSettings = Joi96.object({
44118
44177
  _id: Joi96.string().hex().optional().allow("", null),
@@ -44160,21 +44219,21 @@ function MEntryPassSettings(value) {
44160
44219
  }
44161
44220
  if (value._id && typeof value._id === "string") {
44162
44221
  try {
44163
- value._id = new ObjectId102(value._id);
44222
+ value._id = new ObjectId103(value._id);
44164
44223
  } catch {
44165
44224
  throw new BadRequestError158("Invalid _id format");
44166
44225
  }
44167
44226
  }
44168
44227
  if (value.site && typeof value.site === "string") {
44169
44228
  try {
44170
- value.site = new ObjectId102(value.site);
44229
+ value.site = new ObjectId103(value.site);
44171
44230
  } catch {
44172
44231
  throw new BadRequestError158("Invalid site format");
44173
44232
  }
44174
44233
  }
44175
44234
  if (value.org && typeof value.org === "string") {
44176
44235
  try {
44177
- value.org = new ObjectId102(value.org);
44236
+ value.org = new ObjectId103(value.org);
44178
44237
  } catch {
44179
44238
  throw new BadRequestError158("Invalid org format");
44180
44239
  }
@@ -44213,7 +44272,7 @@ import {
44213
44272
  useAtlas as useAtlas86,
44214
44273
  useCache as useCache52
44215
44274
  } from "@7365admin1/node-server-utils";
44216
- import { ObjectId as ObjectId103 } from "mongodb";
44275
+ import { ObjectId as ObjectId104 } from "mongodb";
44217
44276
  function useEntryPassSettingsRepo() {
44218
44277
  const db = useAtlas86.getDb();
44219
44278
  if (!db) {
@@ -44323,7 +44382,7 @@ function useEntryPassSettingsRepo() {
44323
44382
  }
44324
44383
  async function getEntryPassSettingsById(_id) {
44325
44384
  try {
44326
- _id = new ObjectId103(_id);
44385
+ _id = new ObjectId104(_id);
44327
44386
  } catch (error) {
44328
44387
  throw new BadRequestError159("Invalid entry pass settings ID format.");
44329
44388
  }
@@ -44390,7 +44449,7 @@ function useEntryPassSettingsRepo() {
44390
44449
  }
44391
44450
  async function updateEntryPassSettingsById(_id, value) {
44392
44451
  try {
44393
- _id = new ObjectId103(_id);
44452
+ _id = new ObjectId104(_id);
44394
44453
  } catch (error) {
44395
44454
  throw new BadRequestError159("Invalid entry pass settings ID format.");
44396
44455
  }
@@ -44418,7 +44477,7 @@ function useEntryPassSettingsRepo() {
44418
44477
  }
44419
44478
  async function deleteEntryPassSettingsById(_id, session) {
44420
44479
  try {
44421
- _id = new ObjectId103(_id);
44480
+ _id = new ObjectId104(_id);
44422
44481
  } catch (error) {
44423
44482
  throw new BadRequestError159("Invalid card ID format.");
44424
44483
  }
@@ -44451,7 +44510,7 @@ function useEntryPassSettingsRepo() {
44451
44510
  }
44452
44511
  async function getEntryPassSettingsBySiteId(site) {
44453
44512
  try {
44454
- site = new ObjectId103(site);
44513
+ site = new ObjectId104(site);
44455
44514
  } catch (error) {
44456
44515
  throw new BadRequestError159("Invalid entry pass settings ID format.");
44457
44516
  }
@@ -44518,7 +44577,7 @@ function useEntryPassSettingsRepo() {
44518
44577
  }
44519
44578
  async function updateEntryPassSettingsBySiteId(site, value) {
44520
44579
  try {
44521
- site = new ObjectId103(site);
44580
+ site = new ObjectId104(site);
44522
44581
  } catch (error) {
44523
44582
  throw new BadRequestError159("Invalid entry pass settings ID format.");
44524
44583
  }
@@ -44883,7 +44942,7 @@ function useDashboardController() {
44883
44942
  }
44884
44943
 
44885
44944
  // src/models/nfc-patrol-route.model.ts
44886
- import { ObjectId as ObjectId104 } from "mongodb";
44945
+ import { ObjectId as ObjectId105 } from "mongodb";
44887
44946
  import Joi99 from "joi";
44888
44947
  import { BadRequestError as BadRequestError162, logger as logger139 } from "@7365admin1/node-server-utils";
44889
44948
  var schemaNfcPatrolRoute = Joi99.object({
@@ -44919,23 +44978,23 @@ function MNfcPatrolRoute(value) {
44919
44978
  }
44920
44979
  if (value._id && typeof value._id === "string") {
44921
44980
  try {
44922
- value._id = new ObjectId104(value._id);
44981
+ value._id = new ObjectId105(value._id);
44923
44982
  } catch (error2) {
44924
44983
  throw new BadRequestError162("Invalid _id format");
44925
44984
  }
44926
44985
  }
44927
44986
  try {
44928
- value.site = new ObjectId104(value.site);
44987
+ value.site = new ObjectId105(value.site);
44929
44988
  } catch (error2) {
44930
44989
  throw new BadRequestError162("Invalid site format");
44931
44990
  }
44932
44991
  try {
44933
- value.createdBy = new ObjectId104(value.createdBy);
44992
+ value.createdBy = new ObjectId105(value.createdBy);
44934
44993
  } catch (error2) {
44935
44994
  throw new BadRequestError162("Invalid createdBy format");
44936
44995
  }
44937
44996
  return {
44938
- _id: value._id ?? new ObjectId104(),
44997
+ _id: value._id ?? new ObjectId105(),
44939
44998
  site: value.site,
44940
44999
  name: value.name,
44941
45000
  checkPointNumber: value.checkPointNumber,
@@ -44960,7 +45019,7 @@ import {
44960
45019
  useAtlas as useAtlas88,
44961
45020
  useCache as useCache54
44962
45021
  } from "@7365admin1/node-server-utils";
44963
- import { ObjectId as ObjectId105 } from "mongodb";
45022
+ import { ObjectId as ObjectId106 } from "mongodb";
44964
45023
  function useNfcPatrolRouteRepo() {
44965
45024
  const db = useAtlas88.getDb();
44966
45025
  if (!db) {
@@ -45004,7 +45063,7 @@ function useNfcPatrolRouteRepo() {
45004
45063
  }, session) {
45005
45064
  page = page > 0 ? page - 1 : 0;
45006
45065
  try {
45007
- site = new ObjectId105(site);
45066
+ site = new ObjectId106(site);
45008
45067
  } catch (error) {
45009
45068
  throw new BadRequestError163("Invalid site ID format.");
45010
45069
  }
@@ -45075,7 +45134,7 @@ function useNfcPatrolRouteRepo() {
45075
45134
  }
45076
45135
  async function getById(_id, isStart) {
45077
45136
  try {
45078
- _id = new ObjectId105(_id);
45137
+ _id = new ObjectId106(_id);
45079
45138
  } catch (error) {
45080
45139
  throw new BadRequestError163("Invalid ID.");
45081
45140
  }
@@ -45185,18 +45244,18 @@ function useNfcPatrolRouteRepo() {
45185
45244
  throw new BadRequestError163(error.message);
45186
45245
  }
45187
45246
  try {
45188
- _id = new ObjectId105(_id);
45247
+ _id = new ObjectId106(_id);
45189
45248
  } catch (error2) {
45190
45249
  throw new BadRequestError163("Invalid ID.");
45191
45250
  }
45192
45251
  try {
45193
- value.site = new ObjectId105(value.site);
45252
+ value.site = new ObjectId106(value.site);
45194
45253
  } catch (error2) {
45195
45254
  throw new BadRequestError163("Invalid site format");
45196
45255
  }
45197
45256
  if (value.updatedBy) {
45198
45257
  try {
45199
- value.updatedBy = new ObjectId105(value.updatedBy);
45258
+ value.updatedBy = new ObjectId106(value.updatedBy);
45200
45259
  } catch (error2) {
45201
45260
  throw new BadRequestError163("Invalid createdBy format");
45202
45261
  }
@@ -45429,7 +45488,7 @@ function useNfcPatrolRouteController() {
45429
45488
  }
45430
45489
 
45431
45490
  // src/models/incident-report.model.ts
45432
- import { ObjectId as ObjectId106 } from "mongodb";
45491
+ import { ObjectId as ObjectId107 } from "mongodb";
45433
45492
  import Joi101 from "joi";
45434
45493
  var residentSchema = Joi101.object({
45435
45494
  _id: Joi101.string().hex().optional().allow(null, ""),
@@ -45635,28 +45694,28 @@ var schemaUpdateIncidentReport = Joi101.object({
45635
45694
  function MIncidentReport(value) {
45636
45695
  if (value._id && typeof value._id === "string") {
45637
45696
  try {
45638
- value._id = new ObjectId106(value._id);
45697
+ value._id = new ObjectId107(value._id);
45639
45698
  } catch {
45640
45699
  throw new Error("Invalid incident report ID.");
45641
45700
  }
45642
45701
  }
45643
45702
  if (value.organization && typeof value.organization === "string") {
45644
45703
  try {
45645
- value.organization = new ObjectId106(value.organization);
45704
+ value.organization = new ObjectId107(value.organization);
45646
45705
  } catch {
45647
45706
  throw new Error("Invalid organization ID.");
45648
45707
  }
45649
45708
  }
45650
45709
  if (value.site && typeof value.site === "string") {
45651
45710
  try {
45652
- value.site = new ObjectId106(value.site);
45711
+ value.site = new ObjectId107(value.site);
45653
45712
  } catch {
45654
45713
  throw new Error("Invalid site ID.");
45655
45714
  }
45656
45715
  }
45657
45716
  if (value.approvedBy && typeof value.approvedBy === "string") {
45658
45717
  try {
45659
- value.approvedBy = new ObjectId106(value.approvedBy);
45718
+ value.approvedBy = new ObjectId107(value.approvedBy);
45660
45719
  } catch {
45661
45720
  throw new Error("Invalid approvedBy ID.");
45662
45721
  }
@@ -45664,7 +45723,7 @@ function MIncidentReport(value) {
45664
45723
  const { incidentInformation } = value;
45665
45724
  if (incidentInformation?.siteInfo?.site && typeof incidentInformation.siteInfo.site === "string") {
45666
45725
  try {
45667
- incidentInformation.siteInfo.site = new ObjectId106(
45726
+ incidentInformation.siteInfo.site = new ObjectId107(
45668
45727
  incidentInformation.siteInfo.site
45669
45728
  );
45670
45729
  } catch {
@@ -45678,7 +45737,7 @@ function MIncidentReport(value) {
45678
45737
  incidentInformation.submissionForm.dateOfReport = incidentInformation.submissionForm.dateOfReport.toISOString();
45679
45738
  }
45680
45739
  return {
45681
- _id: value._id ?? new ObjectId106(),
45740
+ _id: value._id ?? new ObjectId107(),
45682
45741
  reportId: value.reportId,
45683
45742
  incidentInformation: value.incidentInformation,
45684
45743
  affectedEntities: value.affectedEntities,
@@ -45716,7 +45775,7 @@ import {
45716
45775
  useAtlas as useAtlas90,
45717
45776
  useCache as useCache55
45718
45777
  } from "@7365admin1/node-server-utils";
45719
- import { ObjectId as ObjectId107 } from "mongodb";
45778
+ import { ObjectId as ObjectId108 } from "mongodb";
45720
45779
  var incidents_namespace_collection = "incident-reports";
45721
45780
  function useIncidentReportRepo() {
45722
45781
  const db = useAtlas90.getDb();
@@ -45783,7 +45842,7 @@ function useIncidentReportRepo() {
45783
45842
  page = page > 0 ? page - 1 : 0;
45784
45843
  let dateExpr = {};
45785
45844
  try {
45786
- site = new ObjectId107(site);
45845
+ site = new ObjectId108(site);
45787
45846
  } catch (error) {
45788
45847
  throw new BadRequestError166("Invalid site ID format.");
45789
45848
  }
@@ -45884,7 +45943,7 @@ function useIncidentReportRepo() {
45884
45943
  page = page > 0 ? page - 1 : 0;
45885
45944
  let dateExpr = {};
45886
45945
  try {
45887
- site = new ObjectId107(site);
45946
+ site = new ObjectId108(site);
45888
45947
  } catch (error) {
45889
45948
  throw new BadRequestError166("Invalid site ID format.");
45890
45949
  }
@@ -45953,7 +46012,7 @@ function useIncidentReportRepo() {
45953
46012
  }
45954
46013
  async function getIncidentReportById(_id, session) {
45955
46014
  try {
45956
- _id = new ObjectId107(_id);
46015
+ _id = new ObjectId108(_id);
45957
46016
  } catch (error) {
45958
46017
  throw new BadRequestError166("Invalid incident report ID format.");
45959
46018
  }
@@ -45984,27 +46043,27 @@ function useIncidentReportRepo() {
45984
46043
  async function updateIncidentReportById(_id, value, session) {
45985
46044
  value.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
45986
46045
  try {
45987
- _id = new ObjectId107(_id);
46046
+ _id = new ObjectId108(_id);
45988
46047
  } catch (error) {
45989
46048
  throw new BadRequestError166("Invalid ID format.");
45990
46049
  }
45991
46050
  if (value.organization && typeof value.organization === "string") {
45992
46051
  try {
45993
- value.organization = new ObjectId107(value.organization);
46052
+ value.organization = new ObjectId108(value.organization);
45994
46053
  } catch {
45995
46054
  throw new Error("Invalid organization ID.");
45996
46055
  }
45997
46056
  }
45998
46057
  if (value.site && typeof value.site === "string") {
45999
46058
  try {
46000
- value.site = new ObjectId107(value.site);
46059
+ value.site = new ObjectId108(value.site);
46001
46060
  } catch {
46002
46061
  throw new Error("Invalid site ID.");
46003
46062
  }
46004
46063
  }
46005
46064
  if (value.approvedBy && typeof value.approvedBy === "string") {
46006
46065
  try {
46007
- value.approvedBy = new ObjectId107(value.approvedBy);
46066
+ value.approvedBy = new ObjectId108(value.approvedBy);
46008
46067
  } catch {
46009
46068
  throw new Error("Invalid approvedBy ID.");
46010
46069
  }
@@ -46012,7 +46071,7 @@ function useIncidentReportRepo() {
46012
46071
  const { incidentInformation } = value;
46013
46072
  if (incidentInformation?.siteInfo?.site && typeof incidentInformation.siteInfo.site === "string") {
46014
46073
  try {
46015
- incidentInformation.siteInfo.site = new ObjectId107(
46074
+ incidentInformation.siteInfo.site = new ObjectId108(
46016
46075
  incidentInformation.siteInfo.site
46017
46076
  );
46018
46077
  } catch {
@@ -46047,7 +46106,7 @@ function useIncidentReportRepo() {
46047
46106
  }
46048
46107
  async function deleteIncidentReportById(_id) {
46049
46108
  try {
46050
- _id = new ObjectId107(_id);
46109
+ _id = new ObjectId108(_id);
46051
46110
  } catch (error) {
46052
46111
  throw new BadRequestError166("Invalid occurrence subject ID format.");
46053
46112
  }
@@ -46079,7 +46138,7 @@ function useIncidentReportRepo() {
46079
46138
  async function reviewIncidentReport(_id, value, session) {
46080
46139
  value.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
46081
46140
  try {
46082
- _id = new ObjectId107(_id);
46141
+ _id = new ObjectId108(_id);
46083
46142
  } catch (error) {
46084
46143
  throw new BadRequestError166("Invalid ID format.");
46085
46144
  }
@@ -46572,7 +46631,7 @@ function useIncidentReportController() {
46572
46631
  }
46573
46632
 
46574
46633
  // src/models/nfc-patrol-settings.model.ts
46575
- import { ObjectId as ObjectId108 } from "mongodb";
46634
+ import { ObjectId as ObjectId109 } from "mongodb";
46576
46635
  import Joi103 from "joi";
46577
46636
  import { BadRequestError as BadRequestError169, logger as logger145 } from "@7365admin1/node-server-utils";
46578
46637
  var objectId = Joi103.string().hex().length(24);
@@ -46598,7 +46657,7 @@ function MNfcPatrolSettings(value) {
46598
46657
  }
46599
46658
  if (value.site) {
46600
46659
  try {
46601
- value.site = new ObjectId108(value.site);
46660
+ value.site = new ObjectId109(value.site);
46602
46661
  } catch (error2) {
46603
46662
  throw new BadRequestError169("Invalid site ID format.");
46604
46663
  }
@@ -46618,7 +46677,7 @@ function MNfcPatrolSettingsUpdate(value) {
46618
46677
  }
46619
46678
  if (value.updatedBy) {
46620
46679
  try {
46621
- value.updatedBy = new ObjectId108(value.updatedBy);
46680
+ value.updatedBy = new ObjectId109(value.updatedBy);
46622
46681
  } catch (error2) {
46623
46682
  throw new BadRequestError169("Invalid updatedBy ID format.");
46624
46683
  }
@@ -46640,7 +46699,7 @@ import {
46640
46699
  useAtlas as useAtlas92,
46641
46700
  useCache as useCache56
46642
46701
  } from "@7365admin1/node-server-utils";
46643
- import { ObjectId as ObjectId109 } from "mongodb";
46702
+ import { ObjectId as ObjectId110 } from "mongodb";
46644
46703
  function useNfcPatrolSettingsRepository() {
46645
46704
  const db = useAtlas92.getDb();
46646
46705
  if (!db) {
@@ -46670,7 +46729,7 @@ function useNfcPatrolSettingsRepository() {
46670
46729
  }
46671
46730
  async function getNfcPatrolSettingsBySite(site, session) {
46672
46731
  try {
46673
- site = new ObjectId109(site);
46732
+ site = new ObjectId110(site);
46674
46733
  } catch (error) {
46675
46734
  throw new BadRequestError170("Invalid nfc patrol settings site ID format.");
46676
46735
  }
@@ -46714,7 +46773,7 @@ function useNfcPatrolSettingsRepository() {
46714
46773
  }
46715
46774
  async function updateNfcPatrolSettings(site, value, session) {
46716
46775
  try {
46717
- site = new ObjectId109(site);
46776
+ site = new ObjectId110(site);
46718
46777
  } catch (error) {
46719
46778
  throw new BadRequestError170("Invalid attendance settings ID format.");
46720
46779
  }
@@ -46883,7 +46942,7 @@ function useNfcPatrolSettingsController() {
46883
46942
 
46884
46943
  // src/services/occurrence-entry.service.ts
46885
46944
  import { useAtlas as useAtlas95 } from "@7365admin1/node-server-utils";
46886
- import { ObjectId as ObjectId112 } from "mongodb";
46945
+ import { ObjectId as ObjectId113 } from "mongodb";
46887
46946
 
46888
46947
  // src/repositories/occurrence-subject.repo.ts
46889
46948
  import {
@@ -46898,7 +46957,7 @@ import {
46898
46957
  } from "@7365admin1/node-server-utils";
46899
46958
 
46900
46959
  // src/models/occurrence-subject.model.ts
46901
- import { ObjectId as ObjectId110 } from "mongodb";
46960
+ import { ObjectId as ObjectId111 } from "mongodb";
46902
46961
  import Joi105 from "joi";
46903
46962
  var SubjectSort = /* @__PURE__ */ ((SubjectSort2) => {
46904
46963
  SubjectSort2["CREATED_AT"] = "createdAt";
@@ -46923,27 +46982,27 @@ var schemaUpdateOccurrenceSubject = Joi105.object({
46923
46982
  function MOccurrenceSubject(value) {
46924
46983
  if (value._id && typeof value._id === "string") {
46925
46984
  try {
46926
- value._id = new ObjectId110(value._id);
46985
+ value._id = new ObjectId111(value._id);
46927
46986
  } catch {
46928
46987
  throw new Error("Invalid ID.");
46929
46988
  }
46930
46989
  }
46931
46990
  if (value.site && typeof value.site === "string") {
46932
46991
  try {
46933
- value.site = new ObjectId110(value.site);
46992
+ value.site = new ObjectId111(value.site);
46934
46993
  } catch {
46935
46994
  throw new Error("Invalid site ID.");
46936
46995
  }
46937
46996
  }
46938
46997
  if (value.addedBy && typeof value.addedBy === "string") {
46939
46998
  try {
46940
- value.addedBy = new ObjectId110(value.addedBy);
46999
+ value.addedBy = new ObjectId111(value.addedBy);
46941
47000
  } catch {
46942
47001
  throw new Error("Invalid addedBy ID.");
46943
47002
  }
46944
47003
  }
46945
47004
  return {
46946
- _id: value._id ?? new ObjectId110(),
47005
+ _id: value._id ?? new ObjectId111(),
46947
47006
  site: value.site,
46948
47007
  subject: value.subject,
46949
47008
  addedBy: value.addedBy ?? "",
@@ -46954,7 +47013,7 @@ function MOccurrenceSubject(value) {
46954
47013
  }
46955
47014
 
46956
47015
  // src/repositories/occurrence-subject.repo.ts
46957
- import { ObjectId as ObjectId111 } from "mongodb";
47016
+ import { ObjectId as ObjectId112 } from "mongodb";
46958
47017
  function useOccurrenceSubjectRepo() {
46959
47018
  const db = useAtlas94.getDb();
46960
47019
  if (!db) {
@@ -47013,7 +47072,7 @@ function useOccurrenceSubjectRepo() {
47013
47072
  }, session) {
47014
47073
  page = page > 0 ? page - 1 : 0;
47015
47074
  try {
47016
- site = new ObjectId111(site);
47075
+ site = new ObjectId112(site);
47017
47076
  } catch (error) {
47018
47077
  throw new BadRequestError173("Invalid site ID format.");
47019
47078
  }
@@ -47106,7 +47165,7 @@ function useOccurrenceSubjectRepo() {
47106
47165
  }
47107
47166
  async function getOccurrenceSubjectById(_id, session) {
47108
47167
  try {
47109
- _id = new ObjectId111(_id);
47168
+ _id = new ObjectId112(_id);
47110
47169
  } catch (error) {
47111
47170
  throw new BadRequestError173("Invalid occurrence subject ID format.");
47112
47171
  }
@@ -47134,7 +47193,7 @@ function useOccurrenceSubjectRepo() {
47134
47193
  async function updateOccurrenceSubjectById(_id, value, session) {
47135
47194
  value.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
47136
47195
  try {
47137
- _id = new ObjectId111(_id);
47196
+ _id = new ObjectId112(_id);
47138
47197
  } catch (error) {
47139
47198
  throw new BadRequestError173("Invalid ID format.");
47140
47199
  }
@@ -47164,7 +47223,7 @@ function useOccurrenceSubjectRepo() {
47164
47223
  }
47165
47224
  async function deleteOccurrenceSubjectById(_id) {
47166
47225
  try {
47167
- _id = new ObjectId111(_id);
47226
+ _id = new ObjectId112(_id);
47168
47227
  } catch (error) {
47169
47228
  throw new BadRequestError173("Invalid occurrence subject ID format.");
47170
47229
  }
@@ -47295,8 +47354,8 @@ function useOccurrenceEntryService() {
47295
47354
  value.dailyOccurrenceBookId = occurrenceEntry.dailyOccurrenceBookId;
47296
47355
  value.bookEntryCount = value.bookEntryCount ? value.bookEntryCount : occurrenceEntry.bookEntryCount;
47297
47356
  value.occurrence = value.occurrence ? value.occurrence : occurrenceEntry.occurrence;
47298
- value.signature = value.signature ? new ObjectId112(value.signature) : occurrenceEntry.signature._id;
47299
- value.eSignature = value.eSignature ? new ObjectId112(value.eSignature) : occurrenceEntry.eSignature;
47357
+ value.signature = value.signature ? new ObjectId113(value.signature) : occurrenceEntry.signature._id;
47358
+ value.eSignature = value.eSignature ? new ObjectId113(value.eSignature) : occurrenceEntry.eSignature;
47300
47359
  value.createdAt = /* @__PURE__ */ new Date();
47301
47360
  value.date = value.date ? value.date : occurrenceEntry.date;
47302
47361
  value.userName = value.userName ? value.userName : occurrenceEntry.signature.name;
@@ -47488,7 +47547,7 @@ function useOccurrenceEntryController() {
47488
47547
 
47489
47548
  // src/models/online-form.model.ts
47490
47549
  import Joi107 from "joi";
47491
- import { ObjectId as ObjectId113 } from "mongodb";
47550
+ import { ObjectId as ObjectId114 } from "mongodb";
47492
47551
  var schemaOnlineForm = Joi107.object({
47493
47552
  _id: Joi107.string().hex().optional().allow("", null),
47494
47553
  name: Joi107.string().required(),
@@ -47536,21 +47595,21 @@ function MOnlineForm(value) {
47536
47595
  }
47537
47596
  if (value._id && typeof value._id === "string") {
47538
47597
  try {
47539
- value._id = new ObjectId113(value._id);
47598
+ value._id = new ObjectId114(value._id);
47540
47599
  } catch (error2) {
47541
47600
  throw new Error("Invalid ID.");
47542
47601
  }
47543
47602
  }
47544
47603
  if (value.org && typeof value.org === "string") {
47545
47604
  try {
47546
- value.org = new ObjectId113(value.org);
47605
+ value.org = new ObjectId114(value.org);
47547
47606
  } catch (error2) {
47548
47607
  throw new Error("Invalid org ID.");
47549
47608
  }
47550
47609
  }
47551
47610
  if (value.site && typeof value.site === "string") {
47552
47611
  try {
47553
- value.site = new ObjectId113(value.site);
47612
+ value.site = new ObjectId114(value.site);
47554
47613
  } catch (error2) {
47555
47614
  throw new Error("Invalid site ID.");
47556
47615
  }
@@ -47582,7 +47641,7 @@ import {
47582
47641
  useAtlas as useAtlas96,
47583
47642
  useCache as useCache58
47584
47643
  } from "@7365admin1/node-server-utils";
47585
- import { ObjectId as ObjectId114 } from "mongodb";
47644
+ import { ObjectId as ObjectId115 } from "mongodb";
47586
47645
  function useOnlineFormRepo() {
47587
47646
  const db = useAtlas96.getDb();
47588
47647
  if (!db) {
@@ -47634,7 +47693,7 @@ function useOnlineFormRepo() {
47634
47693
  }) {
47635
47694
  page = page > 0 ? page - 1 : 0;
47636
47695
  try {
47637
- site = new ObjectId114(site);
47696
+ site = new ObjectId115(site);
47638
47697
  } catch (error) {
47639
47698
  throw new BadRequestError175("Invalid site ID format.");
47640
47699
  }
@@ -47694,7 +47753,7 @@ function useOnlineFormRepo() {
47694
47753
  }
47695
47754
  async function getOnlineFormById(_id) {
47696
47755
  try {
47697
- _id = new ObjectId114(_id);
47756
+ _id = new ObjectId115(_id);
47698
47757
  } catch (error) {
47699
47758
  throw new BadRequestError175("Invalid online form ID format.");
47700
47759
  }
@@ -47737,7 +47796,7 @@ function useOnlineFormRepo() {
47737
47796
  }
47738
47797
  async function updateOnlineFormById(_id, value) {
47739
47798
  try {
47740
- _id = new ObjectId114(_id);
47799
+ _id = new ObjectId115(_id);
47741
47800
  } catch (error) {
47742
47801
  throw new BadRequestError175("Invalid online form ID format.");
47743
47802
  }
@@ -47765,7 +47824,7 @@ function useOnlineFormRepo() {
47765
47824
  }
47766
47825
  async function deleteOnlineFormById(_id, session) {
47767
47826
  try {
47768
- _id = new ObjectId114(_id);
47827
+ _id = new ObjectId115(_id);
47769
47828
  } catch (error) {
47770
47829
  throw new BadRequestError175("Invalid online form ID format.");
47771
47830
  }
@@ -47798,7 +47857,7 @@ function useOnlineFormRepo() {
47798
47857
  }
47799
47858
  async function getOnlineFormsBySiteId(site, { search = "", page = 1, limit = 10, status = "active" }) {
47800
47859
  try {
47801
- site = new ObjectId114(site);
47860
+ site = new ObjectId115(site);
47802
47861
  } catch (error) {
47803
47862
  throw new BadRequestError175(
47804
47863
  "Invalid online form configuration site ID format."
@@ -48230,7 +48289,7 @@ function useOccurrenceSubjectController() {
48230
48289
  }
48231
48290
 
48232
48291
  // src/models/nfc-patrol-log.model.ts
48233
- import { ObjectId as ObjectId115 } from "mongodb";
48292
+ import { ObjectId as ObjectId116 } from "mongodb";
48234
48293
  import Joi110 from "joi";
48235
48294
  import { BadRequestError as BadRequestError178, logger as logger154 } from "@7365admin1/node-server-utils";
48236
48295
  var schemaNfcPatrolLog = Joi110.object({
@@ -48282,32 +48341,32 @@ function MNfcPatrolLog(valueArg) {
48282
48341
  }
48283
48342
  if (value._id && typeof value._id === "string") {
48284
48343
  try {
48285
- value._id = new ObjectId115(value._id);
48344
+ value._id = new ObjectId116(value._id);
48286
48345
  } catch (error2) {
48287
48346
  throw new BadRequestError178("Invalid _id format");
48288
48347
  }
48289
48348
  }
48290
48349
  try {
48291
- value.site = new ObjectId115(value.site);
48350
+ value.site = new ObjectId116(value.site);
48292
48351
  } catch (error2) {
48293
48352
  throw new BadRequestError178("Invalid site format");
48294
48353
  }
48295
48354
  if (value?.createdBy) {
48296
48355
  try {
48297
- value.createdBy = new ObjectId115(value.createdBy);
48356
+ value.createdBy = new ObjectId116(value.createdBy);
48298
48357
  } catch (error2) {
48299
48358
  throw new BadRequestError178("Invalid createdBy format");
48300
48359
  }
48301
48360
  }
48302
48361
  if (value?.route?._id) {
48303
48362
  try {
48304
- value.route._id = new ObjectId115(value.route._id);
48363
+ value.route._id = new ObjectId116(value.route._id);
48305
48364
  } catch (error2) {
48306
48365
  throw new BadRequestError178("Invalid route _id format");
48307
48366
  }
48308
48367
  }
48309
48368
  return {
48310
- _id: value._id ?? new ObjectId115(),
48369
+ _id: value._id ?? new ObjectId116(),
48311
48370
  site: value.site,
48312
48371
  route: value.route,
48313
48372
  date: value.date,
@@ -48329,7 +48388,7 @@ import {
48329
48388
  useAtlas as useAtlas98,
48330
48389
  useCache as useCache59
48331
48390
  } from "@7365admin1/node-server-utils";
48332
- import { ObjectId as ObjectId116 } from "mongodb";
48391
+ import { ObjectId as ObjectId117 } from "mongodb";
48333
48392
  function useNfcPatrolLogRepo() {
48334
48393
  const db = useAtlas98.getDb();
48335
48394
  if (!db) {
@@ -48382,7 +48441,7 @@ function useNfcPatrolLogRepo() {
48382
48441
  const pageIndex = page > 0 ? page - 1 : 0;
48383
48442
  let siteId;
48384
48443
  try {
48385
- siteId = typeof site === "string" ? new ObjectId116(site) : site;
48444
+ siteId = typeof site === "string" ? new ObjectId117(site) : site;
48386
48445
  } catch {
48387
48446
  throw new BadRequestError179("Invalid site ID format.");
48388
48447
  }
@@ -48393,7 +48452,7 @@ function useNfcPatrolLogRepo() {
48393
48452
  query.date = date;
48394
48453
  }
48395
48454
  if (route?._id) {
48396
- query["route._id"] = typeof route._id === "string" ? new ObjectId116(route._id) : route._id;
48455
+ query["route._id"] = typeof route._id === "string" ? new ObjectId117(route._id) : route._id;
48397
48456
  }
48398
48457
  if (route?.startTime) {
48399
48458
  query["route.startTime"] = route.startTime;
@@ -49265,7 +49324,7 @@ function useNewDashboardController() {
49265
49324
 
49266
49325
  // src/models/manpower-monitoring.model.ts
49267
49326
  import Joi113 from "joi";
49268
- import { ObjectId as ObjectId117 } from "mongodb";
49327
+ import { ObjectId as ObjectId118 } from "mongodb";
49269
49328
  var shiftSchema = Joi113.object({
49270
49329
  name: Joi113.string().required(),
49271
49330
  checkIn: Joi113.string().optional().allow("", null),
@@ -49290,7 +49349,7 @@ var manpowerMonitoringSchema = Joi113.object({
49290
49349
  });
49291
49350
  var MManpowerMonitoring = class {
49292
49351
  constructor(data) {
49293
- this._id = new ObjectId117();
49352
+ this._id = new ObjectId118();
49294
49353
  this.serviceProviderId = data.serviceProviderId || "";
49295
49354
  this.siteId = data.siteId || "";
49296
49355
  this.siteName = data.siteName;
@@ -49763,7 +49822,7 @@ var hrmlabs_attendance_util_default = {
49763
49822
  };
49764
49823
 
49765
49824
  // src/repositories/manpower-monitoring.repo.ts
49766
- import { ObjectId as ObjectId118 } from "mongodb";
49825
+ import { ObjectId as ObjectId119 } from "mongodb";
49767
49826
  var { hrmLabsAuthentication: hrmLabsAuthentication2, fetchSites: fetchSites2 } = hrmlabs_attendance_util_default;
49768
49827
  function useManpowerMonitoringRepo() {
49769
49828
  const db = useAtlas101.getDb();
@@ -49798,11 +49857,11 @@ function useManpowerMonitoringRepo() {
49798
49857
  try {
49799
49858
  value = new MManpowerMonitoring(value);
49800
49859
  if (value.createdBy)
49801
- value.createdBy = new ObjectId118(value.createdBy);
49860
+ value.createdBy = new ObjectId119(value.createdBy);
49802
49861
  if (value.siteId)
49803
- value.siteId = new ObjectId118(value.siteId);
49862
+ value.siteId = new ObjectId119(value.siteId);
49804
49863
  if (value.serviceProviderId)
49805
- value.serviceProviderId = new ObjectId118(value.serviceProviderId);
49864
+ value.serviceProviderId = new ObjectId119(value.serviceProviderId);
49806
49865
  const result = await collection.insertOne(value, { session });
49807
49866
  return result;
49808
49867
  } catch (error) {
@@ -49843,8 +49902,8 @@ function useManpowerMonitoringRepo() {
49843
49902
  }
49844
49903
  async function getManpowerSettingsBySiteId(_id, serviceProviderId) {
49845
49904
  try {
49846
- _id = new ObjectId118(_id);
49847
- serviceProviderId = new ObjectId118(serviceProviderId);
49905
+ _id = new ObjectId119(_id);
49906
+ serviceProviderId = new ObjectId119(serviceProviderId);
49848
49907
  } catch (error) {
49849
49908
  throw new Error("Invalid Site ID format.");
49850
49909
  }
@@ -49860,7 +49919,7 @@ function useManpowerMonitoringRepo() {
49860
49919
  }
49861
49920
  async function updateManpowerMonitoringSettings(_id, value) {
49862
49921
  try {
49863
- _id = new ObjectId118(_id);
49922
+ _id = new ObjectId119(_id);
49864
49923
  } catch (error) {
49865
49924
  throw new BadRequestError184("Invalid ID format.");
49866
49925
  }
@@ -49887,7 +49946,7 @@ function useManpowerMonitoringRepo() {
49887
49946
  for (let item of value) {
49888
49947
  item = new MManpowerMonitoring(item);
49889
49948
  const data = await collection.findOne({
49890
- siteId: new ObjectId118(item.siteId)
49949
+ siteId: new ObjectId119(item.siteId)
49891
49950
  });
49892
49951
  if (data) {
49893
49952
  let updateValue;
@@ -49912,11 +49971,11 @@ function useManpowerMonitoringRepo() {
49912
49971
  }
49913
49972
  } else {
49914
49973
  if (item.createdBy)
49915
- item.createdBy = new ObjectId118(item.createdBy);
49974
+ item.createdBy = new ObjectId119(item.createdBy);
49916
49975
  if (item.siteId)
49917
- item.siteId = new ObjectId118(item.siteId);
49976
+ item.siteId = new ObjectId119(item.siteId);
49918
49977
  if (item.serviceProviderId)
49919
- item.serviceProviderId = new ObjectId118(item.serviceProviderId);
49978
+ item.serviceProviderId = new ObjectId119(item.serviceProviderId);
49920
49979
  const result = await collection.insertOne(item);
49921
49980
  if (result.insertedId) {
49922
49981
  results.inserted++;
@@ -49940,7 +49999,7 @@ function useManpowerMonitoringRepo() {
49940
49999
  const siteUrl = process.env.HRMLABS_SITE_URL;
49941
50000
  try {
49942
50001
  const serviceProvider = await serviceProviderCollection.findOne({
49943
- _id: new ObjectId118(serviceProviderId)
50002
+ _id: new ObjectId119(serviceProviderId)
49944
50003
  });
49945
50004
  if (!serviceProvider) {
49946
50005
  throw new Error("Service Provider not found.");
@@ -49993,7 +50052,7 @@ import {
49993
50052
 
49994
50053
  // src/models/manpower-remarks.model.ts
49995
50054
  import Joi114 from "joi";
49996
- import { ObjectId as ObjectId119 } from "mongodb";
50055
+ import { ObjectId as ObjectId120 } from "mongodb";
49997
50056
  var remarksSchema = Joi114.object({
49998
50057
  name: Joi114.string().required(),
49999
50058
  remark: Joi114.object({
@@ -50017,7 +50076,7 @@ var manpowerRemarksSchema = Joi114.object({
50017
50076
  });
50018
50077
  var MManpowerRemarks = class {
50019
50078
  constructor(data) {
50020
- this._id = new ObjectId119();
50079
+ this._id = new ObjectId120();
50021
50080
  this.serviceProviderId = data.serviceProviderId || "";
50022
50081
  this.siteId = data.siteId || "";
50023
50082
  this.siteName = data.siteName || "";
@@ -50035,7 +50094,7 @@ var MManpowerRemarks = class {
50035
50094
  };
50036
50095
 
50037
50096
  // src/repositories/manpower-remarks.repo.ts
50038
- import { ObjectId as ObjectId120 } from "mongodb";
50097
+ import { ObjectId as ObjectId121 } from "mongodb";
50039
50098
  import moment2 from "moment-timezone";
50040
50099
  function useManpowerRemarksRepo() {
50041
50100
  const db = useAtlas102.getDb();
@@ -50069,9 +50128,9 @@ function useManpowerRemarksRepo() {
50069
50128
  try {
50070
50129
  value = new MManpowerRemarks(value);
50071
50130
  if (value.siteId)
50072
- value.siteId = new ObjectId120(value.siteId);
50131
+ value.siteId = new ObjectId121(value.siteId);
50073
50132
  if (value.serviceProviderId)
50074
- value.serviceProviderId = new ObjectId120(value.serviceProviderId);
50133
+ value.serviceProviderId = new ObjectId121(value.serviceProviderId);
50075
50134
  const result = await collection.insertOne(value, { session });
50076
50135
  return result;
50077
50136
  } catch (error) {
@@ -50091,7 +50150,7 @@ function useManpowerRemarksRepo() {
50091
50150
  limit = limit || 10;
50092
50151
  const searchQuery = {};
50093
50152
  const nowSGT = moment2().tz("Asia/Singapore");
50094
- searchQuery.serviceProviderId = new ObjectId120(serviceProviderId);
50153
+ searchQuery.serviceProviderId = new ObjectId121(serviceProviderId);
50095
50154
  if (search != "") {
50096
50155
  searchQuery.siteName = { $regex: search, $options: "i" };
50097
50156
  }
@@ -50123,8 +50182,8 @@ function useManpowerRemarksRepo() {
50123
50182
  }
50124
50183
  async function getManpowerRemarksBySiteId(_id, date, serviceProviderId) {
50125
50184
  try {
50126
- _id = new ObjectId120(_id);
50127
- serviceProviderId = new ObjectId120(serviceProviderId);
50185
+ _id = new ObjectId121(_id);
50186
+ serviceProviderId = new ObjectId121(serviceProviderId);
50128
50187
  } catch (error) {
50129
50188
  throw new Error("Invalid Site ID format.");
50130
50189
  }
@@ -50141,13 +50200,13 @@ function useManpowerRemarksRepo() {
50141
50200
  }
50142
50201
  async function updateManpowerRemarks(_id, value) {
50143
50202
  try {
50144
- _id = new ObjectId120(_id);
50203
+ _id = new ObjectId121(_id);
50145
50204
  } catch (error) {
50146
50205
  throw new BadRequestError185("Invalid ID format.");
50147
50206
  }
50148
50207
  try {
50149
50208
  if (value.createdBy) {
50150
- value.createdBy = new ObjectId120(value.createdBy);
50209
+ value.createdBy = new ObjectId121(value.createdBy);
50151
50210
  }
50152
50211
  const updateValue = {
50153
50212
  ...value,
@@ -50164,7 +50223,7 @@ function useManpowerRemarksRepo() {
50164
50223
  }
50165
50224
  async function updateRemarksStatus(_id, value) {
50166
50225
  try {
50167
- _id = new ObjectId120(_id);
50226
+ _id = new ObjectId121(_id);
50168
50227
  } catch (error) {
50169
50228
  throw new BadRequestError185("Invalid ID format.");
50170
50229
  }
@@ -50434,7 +50493,7 @@ function useManpowerMonitoringCtrl() {
50434
50493
 
50435
50494
  // src/models/manpower-designations.model.ts
50436
50495
  import Joi116 from "joi";
50437
- import { ObjectId as ObjectId121 } from "mongodb";
50496
+ import { ObjectId as ObjectId122 } from "mongodb";
50438
50497
  var designationsSchema = Joi116.object({
50439
50498
  title: Joi116.string().required(),
50440
50499
  shifts: Joi116.object({
@@ -50453,7 +50512,7 @@ var manpowerDesignationsSchema = Joi116.object({
50453
50512
  });
50454
50513
  var MManpowerDesignations = class {
50455
50514
  constructor(data) {
50456
- this._id = new ObjectId121();
50515
+ this._id = new ObjectId122();
50457
50516
  this.siteId = data.siteId || "";
50458
50517
  this.siteName = data.siteName || "";
50459
50518
  this.serviceProviderId = data.serviceProviderId || "";
@@ -50471,7 +50530,7 @@ import {
50471
50530
  logger as logger164,
50472
50531
  useAtlas as useAtlas104
50473
50532
  } from "@7365admin1/node-server-utils";
50474
- import { ObjectId as ObjectId122 } from "mongodb";
50533
+ import { ObjectId as ObjectId123 } from "mongodb";
50475
50534
  function useManpowerDesignationRepo() {
50476
50535
  const db = useAtlas104.getDb();
50477
50536
  if (!db) {
@@ -50503,11 +50562,11 @@ function useManpowerDesignationRepo() {
50503
50562
  try {
50504
50563
  value = new MManpowerDesignations(value);
50505
50564
  if (value.createdBy)
50506
- value.createdBy = new ObjectId122(value.createdBy);
50565
+ value.createdBy = new ObjectId123(value.createdBy);
50507
50566
  if (value.siteId)
50508
- value.siteId = new ObjectId122(value.siteId);
50567
+ value.siteId = new ObjectId123(value.siteId);
50509
50568
  if (value.serviceProviderId)
50510
- value.serviceProviderId = new ObjectId122(value.serviceProviderId);
50569
+ value.serviceProviderId = new ObjectId123(value.serviceProviderId);
50511
50570
  const result = await collection.insertOne(value);
50512
50571
  return result;
50513
50572
  } catch (error) {
@@ -50516,8 +50575,8 @@ function useManpowerDesignationRepo() {
50516
50575
  }
50517
50576
  async function getManpowerDesignationsBySiteId(_id, serviceProviderId) {
50518
50577
  try {
50519
- _id = new ObjectId122(_id);
50520
- serviceProviderId = new ObjectId122(serviceProviderId);
50578
+ _id = new ObjectId123(_id);
50579
+ serviceProviderId = new ObjectId123(serviceProviderId);
50521
50580
  } catch (error) {
50522
50581
  throw new Error("Invalid Site ID format.");
50523
50582
  }
@@ -50533,7 +50592,7 @@ function useManpowerDesignationRepo() {
50533
50592
  }
50534
50593
  async function updateManpowerDesignations(_id, value) {
50535
50594
  try {
50536
- _id = new ObjectId122(_id);
50595
+ _id = new ObjectId123(_id);
50537
50596
  } catch (error) {
50538
50597
  throw new Error("Invalid ID format.");
50539
50598
  }
@@ -50637,7 +50696,7 @@ function useManpowerDesignationCtrl() {
50637
50696
 
50638
50697
  // src/models/overnight-parking.model.ts
50639
50698
  import Joi118 from "joi";
50640
- import { ObjectId as ObjectId123 } from "mongodb";
50699
+ import { ObjectId as ObjectId124 } from "mongodb";
50641
50700
  var dayScheduleSchema = Joi118.object({
50642
50701
  isEnabled: Joi118.boolean().required(),
50643
50702
  startTime: Joi118.string().pattern(/^([01]\d|2[0-3]):([0-5]\d)$/).optional().allow(null, "").messages({
@@ -50679,7 +50738,7 @@ function MOvernightParkingApprovalHours(value) {
50679
50738
  }
50680
50739
  if (value.site && typeof value.site === "string") {
50681
50740
  try {
50682
- value.site = new ObjectId123(value.site);
50741
+ value.site = new ObjectId124(value.site);
50683
50742
  } catch {
50684
50743
  throw new Error("Invalid site ID.");
50685
50744
  }
@@ -52303,7 +52362,7 @@ function useManpowerRemarkCtrl() {
52303
52362
 
52304
52363
  // src/models/manpower-sites.model.ts
52305
52364
  import Joi124 from "joi";
52306
- import { ObjectId as ObjectId124 } from "mongodb";
52365
+ import { ObjectId as ObjectId125 } from "mongodb";
52307
52366
  var manpowerSitesSchema = Joi124.object({
52308
52367
  id: Joi124.string().hex().required(),
52309
52368
  text: Joi124.string().hex().optional().allow("", null),
@@ -52314,7 +52373,7 @@ var manpowerSitesSchema = Joi124.object({
52314
52373
  });
52315
52374
  var MManpowerSites = class {
52316
52375
  constructor(data) {
52317
- this._id = new ObjectId124();
52376
+ this._id = new ObjectId125();
52318
52377
  this.id = data.id || "";
52319
52378
  this.text = data.text || "";
52320
52379
  this.contractID = data.contractID || "";
@@ -52536,7 +52595,7 @@ import {
52536
52595
  getDirectory as getDirectory4,
52537
52596
  logger as logger177
52538
52597
  } from "@7365admin1/node-server-utils";
52539
- import { ObjectId as ObjectId125 } from "mongodb";
52598
+ import { ObjectId as ObjectId126 } from "mongodb";
52540
52599
  import moment4 from "moment-timezone";
52541
52600
  var createManpowerRemarksDaily = async () => {
52542
52601
  const db = useAtlas110.getDb();
@@ -52696,7 +52755,7 @@ var updateRemarksisAcknowledged = async () => {
52696
52755
  for (const id of updatedIds) {
52697
52756
  const doc = await remarks.findOne({ _id: id });
52698
52757
  const setting = await settings.findOne(
52699
- { siteId: new ObjectId125(doc?.siteId) },
52758
+ { siteId: new ObjectId126(doc?.siteId) },
52700
52759
  { projection: { emails: 1 } }
52701
52760
  );
52702
52761
  const payload = {
@@ -52782,7 +52841,7 @@ var updateRemarksStatusEod = async () => {
52782
52841
  for (const doc of docs) {
52783
52842
  let shiftsToCheck = [];
52784
52843
  const endShiftTime = await settings.findOne(
52785
- { siteId: new ObjectId125(doc.siteId) },
52844
+ { siteId: new ObjectId126(doc.siteId) },
52786
52845
  { projection: { shifts: 1, shiftType: 1 } }
52787
52846
  );
52788
52847
  if (doc.createdAtSGT === nowSGT) {
@@ -52888,7 +52947,7 @@ var isWithinHour = (alertTime, timeNow) => {
52888
52947
 
52889
52948
  // src/events/manpower.event.ts
52890
52949
  import { useAtlas as useAtlas111 } from "@7365admin1/node-server-utils";
52891
- import { ObjectId as ObjectId126 } from "mongodb";
52950
+ import { ObjectId as ObjectId127 } from "mongodb";
52892
52951
  import moment5 from "moment-timezone";
52893
52952
  async function manpowerEvents(io) {
52894
52953
  let intervalId = null;
@@ -52914,7 +52973,7 @@ async function manpowerEvents(io) {
52914
52973
  }).toArray();
52915
52974
  for (const doc of docs) {
52916
52975
  const siteSettings = await settings.findOne(
52917
- { siteId: new ObjectId126(doc.siteId), enabled: true },
52976
+ { siteId: new ObjectId127(doc.siteId), enabled: true },
52918
52977
  { projection: { shifts: 1, shiftType: 1 } }
52919
52978
  );
52920
52979
  const shiftType = siteSettings?.shiftType || "2-shifts";
@@ -53033,11 +53092,11 @@ function genericSignature(params, secretKey) {
53033
53092
  }
53034
53093
 
53035
53094
  // src/repositories/reddot-payment.repository.ts
53036
- import { ObjectId as ObjectId128 } from "mongodb";
53095
+ import { ObjectId as ObjectId129 } from "mongodb";
53037
53096
 
53038
53097
  // src/models/billing-payments.model.ts
53039
53098
  import { BadRequestError as BadRequestError199, logger as logger178 } from "@7365admin1/node-server-utils";
53040
- import { ObjectId as ObjectId127 } from "mongodb";
53099
+ import { ObjectId as ObjectId128 } from "mongodb";
53041
53100
  import Joi126 from "joi";
53042
53101
  var schemaBillingItems = Joi126.object({
53043
53102
  _id: Joi126.string().hex().optional(),
@@ -53071,21 +53130,21 @@ function MBillingItems(value) {
53071
53130
  }
53072
53131
  if (value._id && typeof value._id === "string") {
53073
53132
  try {
53074
- value._id = new ObjectId127(value._id);
53133
+ value._id = new ObjectId128(value._id);
53075
53134
  } catch {
53076
53135
  throw new BadRequestError199("Invalid _id format");
53077
53136
  }
53078
53137
  }
53079
53138
  if (value.unitId && typeof value.unitId === "string") {
53080
53139
  try {
53081
- value.unitId = new ObjectId127(value.unitId);
53140
+ value.unitId = new ObjectId128(value.unitId);
53082
53141
  } catch {
53083
53142
  throw new BadRequestError199("Invalid unitId id format");
53084
53143
  }
53085
53144
  }
53086
53145
  if (value.paidBy && typeof value.paidBy === "string") {
53087
53146
  try {
53088
- value.paidBy = new ObjectId127(value.paidBy);
53147
+ value.paidBy = new ObjectId128(value.paidBy);
53089
53148
  } catch {
53090
53149
  throw new BadRequestError199("Invalid paidBy id format");
53091
53150
  }
@@ -53095,7 +53154,7 @@ function MBillingItems(value) {
53095
53154
  value.unitBillingItems = value.unitBillingItems.map((unitBillingItem) => {
53096
53155
  if (typeof unitBillingItem._id === "string") {
53097
53156
  try {
53098
- unitBillingItem._id = new ObjectId127(unitBillingItem._id);
53157
+ unitBillingItem._id = new ObjectId128(unitBillingItem._id);
53099
53158
  } catch {
53100
53159
  throw new BadRequestError199("Invalid unit billing id format");
53101
53160
  }
@@ -53107,7 +53166,7 @@ function MBillingItems(value) {
53107
53166
  }
53108
53167
  }
53109
53168
  return {
53110
- _id: value._id ?? new ObjectId127(),
53169
+ _id: value._id ?? new ObjectId128(),
53111
53170
  unitBillingItems: value.unitBillingItems ?? [],
53112
53171
  unitId: value.unitId ?? "",
53113
53172
  unitOwner: value.unitOwner ?? "",
@@ -53181,7 +53240,7 @@ var useRedDotPaymentRepo = () => {
53181
53240
  const res = await paymentCollection().insertOne(payload, { session });
53182
53241
  const unit = payload.unitId?.toString().slice(-4);
53183
53242
  const dateFormatted = formatDateString(/* @__PURE__ */ new Date());
53184
- const newId = new ObjectId128(res.insertedId).toString().slice(-6);
53243
+ const newId = new ObjectId129(res.insertedId).toString().slice(-6);
53185
53244
  const referenceNumber = `${unit}${newId}${dateFormatted}`;
53186
53245
  await paymentCollection().updateOne(
53187
53246
  { _id: res.insertedId },
@@ -54297,7 +54356,7 @@ import {
54297
54356
  import { v4 as uuidv42 } from "uuid";
54298
54357
 
54299
54358
  // src/repositories/user-v2.repo.ts
54300
- import { ObjectId as ObjectId129 } from "mongodb";
54359
+ import { ObjectId as ObjectId130 } from "mongodb";
54301
54360
  import {
54302
54361
  useAtlas as useAtlas115,
54303
54362
  InternalServerError as InternalServerError71,
@@ -54509,7 +54568,7 @@ function useUserRepoV2() {
54509
54568
  }
54510
54569
  if (organization) {
54511
54570
  try {
54512
- query.defaultOrg = new ObjectId129(organization);
54571
+ query.defaultOrg = new ObjectId130(organization);
54513
54572
  cacheOptions.organization = organization.toString();
54514
54573
  } catch (error) {
54515
54574
  throw new BadRequestError204("Invalid organization ID format.");
@@ -54648,13 +54707,13 @@ function useUserRepoV2() {
54648
54707
  );
54649
54708
  }
54650
54709
  try {
54651
- _id = new ObjectId129(_id);
54710
+ _id = new ObjectId130(_id);
54652
54711
  } catch (error) {
54653
54712
  throw new BadRequestError204("Invalid ID.");
54654
54713
  }
54655
54714
  if (field === "defaultOrg") {
54656
54715
  try {
54657
- value = new ObjectId129(value);
54716
+ value = new ObjectId130(value);
54658
54717
  } catch (error) {
54659
54718
  throw new BadRequestError204("Invalid organization ID.");
54660
54719
  }
@@ -54695,7 +54754,7 @@ function useUserRepoV2() {
54695
54754
  year
54696
54755
  }, session) {
54697
54756
  try {
54698
- _id = new ObjectId129(_id);
54757
+ _id = new ObjectId130(_id);
54699
54758
  } catch (error) {
54700
54759
  throw new BadRequestError204("Invalid user ID format.");
54701
54760
  }
@@ -54725,7 +54784,7 @@ function useUserRepoV2() {
54725
54784
  }
54726
54785
  async function updatePassword({ _id, password }, session) {
54727
54786
  try {
54728
- _id = new ObjectId129(_id);
54787
+ _id = new ObjectId130(_id);
54729
54788
  } catch (error) {
54730
54789
  throw new BadRequestError204("Invalid user ID format.");
54731
54790
  }
@@ -55488,38 +55547,38 @@ function useUserControllerV2() {
55488
55547
 
55489
55548
  // src/models/role-v2.model.ts
55490
55549
  import { BadRequestError as BadRequestError209 } from "@7365admin1/node-server-utils";
55491
- import { ObjectId as ObjectId130 } from "mongodb";
55550
+ import { ObjectId as ObjectId131 } from "mongodb";
55492
55551
  var MRoleV2 = class {
55493
55552
  constructor(value) {
55494
55553
  if (typeof value._id === "string") {
55495
55554
  try {
55496
- value._id = new ObjectId130(value._id);
55555
+ value._id = new ObjectId131(value._id);
55497
55556
  } catch (error) {
55498
55557
  throw new BadRequestError209("Invalid role-v2 ID format.");
55499
55558
  }
55500
55559
  }
55501
55560
  if (typeof value.site === "string" && value.site.length === 24) {
55502
55561
  try {
55503
- value.site = new ObjectId130(value.site);
55562
+ value.site = new ObjectId131(value.site);
55504
55563
  } catch (error) {
55505
55564
  throw new BadRequestError209("Invalid site ID format.");
55506
55565
  }
55507
55566
  }
55508
55567
  if (typeof value.org === "string" && value.org.length === 24) {
55509
55568
  try {
55510
- value.org = new ObjectId130(value.org);
55569
+ value.org = new ObjectId131(value.org);
55511
55570
  } catch (error) {
55512
55571
  throw new BadRequestError209("Invalid org ID format.");
55513
55572
  }
55514
55573
  }
55515
55574
  if (value.createdBy) {
55516
55575
  try {
55517
- value.createdBy = new ObjectId130(value.createdBy);
55576
+ value.createdBy = new ObjectId131(value.createdBy);
55518
55577
  } catch (error) {
55519
55578
  throw new BadRequestError209("Invalid created by ID format.");
55520
55579
  }
55521
55580
  }
55522
- this._id = value._id ?? new ObjectId130();
55581
+ this._id = value._id ?? new ObjectId131();
55523
55582
  this.name = value.name ?? "";
55524
55583
  this.permissions = value.permissions ?? [];
55525
55584
  this.site = value.site ?? "";
@@ -55660,7 +55719,7 @@ function useRoleControllerV2() {
55660
55719
 
55661
55720
  // src/models/post-preloved.model.ts
55662
55721
  import Joi133 from "joi";
55663
- import { ObjectId as ObjectId131 } from "mongodb";
55722
+ import { ObjectId as ObjectId132 } from "mongodb";
55664
55723
  var PostStatus = /* @__PURE__ */ ((PostStatus2) => {
55665
55724
  PostStatus2["PUBLISHED"] = "published";
55666
55725
  PostStatus2["RESERVED"] = "reserved";
@@ -55716,28 +55775,28 @@ function MPost(value) {
55716
55775
  }
55717
55776
  if (value._id && typeof value._id === "string") {
55718
55777
  try {
55719
- value._id = new ObjectId131(value._id);
55778
+ value._id = new ObjectId132(value._id);
55720
55779
  } catch {
55721
55780
  throw new Error("Invalid ID.");
55722
55781
  }
55723
55782
  }
55724
55783
  if (value.site && typeof value.site === "string") {
55725
55784
  try {
55726
- value.site = new ObjectId131(value.site);
55785
+ value.site = new ObjectId132(value.site);
55727
55786
  } catch {
55728
55787
  throw new Error("Invalid site ID.");
55729
55788
  }
55730
55789
  }
55731
55790
  if (value.createdBy && typeof value.createdBy === "string") {
55732
55791
  try {
55733
- value.createdBy = new ObjectId131(value.createdBy);
55792
+ value.createdBy = new ObjectId132(value.createdBy);
55734
55793
  } catch {
55735
55794
  throw new Error("Invalid createdBy ID.");
55736
55795
  }
55737
55796
  }
55738
55797
  if (value.reserverId && typeof value.reserverId === "string") {
55739
55798
  try {
55740
- value.reserverId = new ObjectId131(value.reserverId);
55799
+ value.reserverId = new ObjectId132(value.reserverId);
55741
55800
  } catch {
55742
55801
  throw new Error("Invalid reserver ID.");
55743
55802
  }
@@ -55746,7 +55805,7 @@ function MPost(value) {
55746
55805
  value.attachments = value.attachments.map((id) => {
55747
55806
  if (typeof id === "string") {
55748
55807
  try {
55749
- return new ObjectId131(id);
55808
+ return new ObjectId132(id);
55750
55809
  } catch {
55751
55810
  throw new Error("Invalid attachment ID.");
55752
55811
  }
@@ -55756,20 +55815,20 @@ function MPost(value) {
55756
55815
  }
55757
55816
  if (value.category && typeof value.category === "string") {
55758
55817
  try {
55759
- value.category = new ObjectId131(value.category);
55818
+ value.category = new ObjectId132(value.category);
55760
55819
  } catch {
55761
55820
  throw new Error("Invalid category ID.");
55762
55821
  }
55763
55822
  }
55764
55823
  if (value.subcategory && typeof value.subcategory === "string") {
55765
55824
  try {
55766
- value.subcategory = new ObjectId131(value.subcategory);
55825
+ value.subcategory = new ObjectId132(value.subcategory);
55767
55826
  } catch {
55768
55827
  throw new Error("Invalid subcategory ID.");
55769
55828
  }
55770
55829
  }
55771
55830
  return {
55772
- _id: value._id ?? new ObjectId131(),
55831
+ _id: value._id ?? new ObjectId132(),
55773
55832
  title: value.title ?? "",
55774
55833
  description: value.description ?? "",
55775
55834
  attachments: value.attachments ?? [],
@@ -55795,7 +55854,7 @@ import {
55795
55854
  paginate as paginate60,
55796
55855
  useAtlas as useAtlas118
55797
55856
  } from "@7365admin1/node-server-utils";
55798
- import { ObjectId as ObjectId132 } from "mongodb";
55857
+ import { ObjectId as ObjectId133 } from "mongodb";
55799
55858
  function usePostPrelovedRepo() {
55800
55859
  const db = useAtlas118.getDb();
55801
55860
  if (!db) {
@@ -55859,7 +55918,7 @@ function usePostPrelovedRepo() {
55859
55918
  }
55860
55919
  async function getById(_id) {
55861
55920
  try {
55862
- _id = new ObjectId132(_id);
55921
+ _id = new ObjectId133(_id);
55863
55922
  } catch {
55864
55923
  throw new BadRequestError212("Invalid post ID format.");
55865
55924
  }
@@ -55892,7 +55951,7 @@ function usePostPrelovedRepo() {
55892
55951
  page = page > 0 ? page - 1 : 0;
55893
55952
  if (site) {
55894
55953
  try {
55895
- site = new ObjectId132(site);
55954
+ site = new ObjectId133(site);
55896
55955
  } catch {
55897
55956
  throw new BadRequestError212("Invalid site ID format.");
55898
55957
  }
@@ -55901,14 +55960,14 @@ function usePostPrelovedRepo() {
55901
55960
  let subcategoryIds = null;
55902
55961
  if (category && subcategory) {
55903
55962
  try {
55904
- categoryId = new ObjectId132(category);
55963
+ categoryId = new ObjectId133(category);
55905
55964
  } catch {
55906
55965
  throw new BadRequestError212("Invalid category ID format.");
55907
55966
  }
55908
55967
  if (subcategory.length > 0) {
55909
55968
  subcategoryIds = subcategory.map((id) => {
55910
55969
  try {
55911
- return new ObjectId132(id);
55970
+ return new ObjectId133(id);
55912
55971
  } catch {
55913
55972
  throw new BadRequestError212("Invalid subcategory ID format.");
55914
55973
  }
@@ -55933,7 +55992,7 @@ function usePostPrelovedRepo() {
55933
55992
  let userObjectId = null;
55934
55993
  if (userId) {
55935
55994
  try {
55936
- userObjectId = new ObjectId132(userId);
55995
+ userObjectId = new ObjectId133(userId);
55937
55996
  } catch {
55938
55997
  throw new BadRequestError212("Invalid user ID format.");
55939
55998
  }
@@ -55982,7 +56041,7 @@ function usePostPrelovedRepo() {
55982
56041
  }
55983
56042
  async function updateById(_id, value, session) {
55984
56043
  try {
55985
- _id = new ObjectId132(_id);
56044
+ _id = new ObjectId133(_id);
55986
56045
  } catch {
55987
56046
  throw new BadRequestError212("Invalid post ID format.");
55988
56047
  }
@@ -56003,7 +56062,7 @@ function usePostPrelovedRepo() {
56003
56062
  }
56004
56063
  async function deleteById(_id, session) {
56005
56064
  try {
56006
- _id = new ObjectId132(_id);
56065
+ _id = new ObjectId133(_id);
56007
56066
  } catch {
56008
56067
  throw new BadRequestError212("Invalid post ID format.");
56009
56068
  }
@@ -56029,7 +56088,7 @@ function usePostPrelovedRepo() {
56029
56088
  }
56030
56089
  async function updateStatus(_id, status, session) {
56031
56090
  try {
56032
- _id = new ObjectId132(_id);
56091
+ _id = new ObjectId133(_id);
56033
56092
  } catch {
56034
56093
  throw new BadRequestError212("Invalid post ID format.");
56035
56094
  }
@@ -56241,7 +56300,7 @@ function usePostPrelovedController() {
56241
56300
 
56242
56301
  // src/models/post-favorite.model.ts
56243
56302
  import Joi135 from "joi";
56244
- import { ObjectId as ObjectId133 } from "mongodb";
56303
+ import { ObjectId as ObjectId134 } from "mongodb";
56245
56304
  var schemaUpdatePostFavorite = Joi135.object({
56246
56305
  userId: Joi135.string().hex().length(24).required()
56247
56306
  });
@@ -56259,14 +56318,14 @@ function MPostFavorite(value) {
56259
56318
  }
56260
56319
  if (value._id && typeof value._id === "string") {
56261
56320
  try {
56262
- value._id = new ObjectId133(value._id);
56321
+ value._id = new ObjectId134(value._id);
56263
56322
  } catch {
56264
56323
  throw new Error("Invalid ID.");
56265
56324
  }
56266
56325
  }
56267
56326
  if (value.postId && typeof value.postId === "string") {
56268
56327
  try {
56269
- value.postId = new ObjectId133(value.postId);
56328
+ value.postId = new ObjectId134(value.postId);
56270
56329
  } catch {
56271
56330
  throw new Error("Invalid post ID.");
56272
56331
  }
@@ -56275,7 +56334,7 @@ function MPostFavorite(value) {
56275
56334
  value.userIds = value.userIds.map((id) => {
56276
56335
  if (typeof id === "string") {
56277
56336
  try {
56278
- return new ObjectId133(id);
56337
+ return new ObjectId134(id);
56279
56338
  } catch {
56280
56339
  throw new Error("Invalid user ID.");
56281
56340
  }
@@ -56284,7 +56343,7 @@ function MPostFavorite(value) {
56284
56343
  });
56285
56344
  }
56286
56345
  return {
56287
- _id: value._id ?? new ObjectId133(),
56346
+ _id: value._id ?? new ObjectId134(),
56288
56347
  postId: value.postId ?? "",
56289
56348
  userIds: value.userIds ?? [],
56290
56349
  createdAt: value.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
@@ -56299,7 +56358,7 @@ import {
56299
56358
  NotFoundError as NotFoundError58,
56300
56359
  useAtlas as useAtlas119
56301
56360
  } from "@7365admin1/node-server-utils";
56302
- import { ObjectId as ObjectId134 } from "mongodb";
56361
+ import { ObjectId as ObjectId135 } from "mongodb";
56303
56362
  function usePostFavoriteRepo() {
56304
56363
  const db = useAtlas119.getDb();
56305
56364
  if (!db) {
@@ -56321,7 +56380,7 @@ function usePostFavoriteRepo() {
56321
56380
  }
56322
56381
  async function getById(_id) {
56323
56382
  try {
56324
- _id = new ObjectId134(_id);
56383
+ _id = new ObjectId135(_id);
56325
56384
  } catch {
56326
56385
  throw new BadRequestError214("Invalid favorite ID format.");
56327
56386
  }
@@ -56332,13 +56391,13 @@ function usePostFavoriteRepo() {
56332
56391
  }
56333
56392
  async function updateById(_id, userId, session) {
56334
56393
  try {
56335
- _id = new ObjectId134(_id);
56394
+ _id = new ObjectId135(_id);
56336
56395
  } catch {
56337
56396
  throw new BadRequestError214("Invalid favorite ID format.");
56338
56397
  }
56339
56398
  let userObjectId;
56340
56399
  try {
56341
- userObjectId = new ObjectId134(userId);
56400
+ userObjectId = new ObjectId135(userId);
56342
56401
  } catch {
56343
56402
  throw new BadRequestError214("Invalid user ID format.");
56344
56403
  }
@@ -56478,7 +56537,7 @@ function usePostFavoriteController() {
56478
56537
 
56479
56538
  // src/models/category-preloved.model.ts
56480
56539
  import Joi137 from "joi";
56481
- import { ObjectId as ObjectId135 } from "mongodb";
56540
+ import { ObjectId as ObjectId136 } from "mongodb";
56482
56541
  var schemaCategoryPreloved = Joi137.object({
56483
56542
  name: Joi137.string().required(),
56484
56543
  createdBy: Joi137.string().hex().optional().allow("", null),
@@ -56495,14 +56554,14 @@ function MCategoryPreloved(value) {
56495
56554
  }
56496
56555
  if (value.createdBy && typeof value.createdBy === "string") {
56497
56556
  try {
56498
- value.createdBy = new ObjectId135(value.createdBy);
56557
+ value.createdBy = new ObjectId136(value.createdBy);
56499
56558
  } catch {
56500
56559
  throw new Error("Invalid createdBy ID.");
56501
56560
  }
56502
56561
  }
56503
56562
  if (value.site && typeof value.site === "string") {
56504
56563
  try {
56505
- value.site = new ObjectId135(value.site);
56564
+ value.site = new ObjectId136(value.site);
56506
56565
  } catch {
56507
56566
  throw new Error("Invalid site ID.");
56508
56567
  }
@@ -56523,7 +56582,7 @@ import {
56523
56582
  NotFoundError as NotFoundError59,
56524
56583
  useAtlas as useAtlas121
56525
56584
  } from "@7365admin1/node-server-utils";
56526
- import { ObjectId as ObjectId136 } from "mongodb";
56585
+ import { ObjectId as ObjectId137 } from "mongodb";
56527
56586
  function useCategoryPrelovedRepo() {
56528
56587
  const db = useAtlas121.getDb();
56529
56588
  if (!db) {
@@ -56537,7 +56596,7 @@ function useCategoryPrelovedRepo() {
56537
56596
  } = {}) {
56538
56597
  if (site) {
56539
56598
  try {
56540
- site = new ObjectId136(site);
56599
+ site = new ObjectId137(site);
56541
56600
  } catch {
56542
56601
  throw new BadRequestError216("Invalid site ID format.");
56543
56602
  }
@@ -56556,7 +56615,7 @@ function useCategoryPrelovedRepo() {
56556
56615
  async function getById(_id) {
56557
56616
  let objectId2;
56558
56617
  try {
56559
- objectId2 = new ObjectId136(_id);
56618
+ objectId2 = new ObjectId137(_id);
56560
56619
  } catch {
56561
56620
  throw new BadRequestError216("Invalid category-preloved ID format.");
56562
56621
  }
@@ -56656,7 +56715,7 @@ function useCategoryPrelovedController() {
56656
56715
 
56657
56716
  // src/models/subcategory-preloved.model.ts
56658
56717
  import Joi139 from "joi";
56659
- import { ObjectId as ObjectId137 } from "mongodb";
56718
+ import { ObjectId as ObjectId138 } from "mongodb";
56660
56719
  var schemaSubcategoryPreloved = Joi139.object({
56661
56720
  name: Joi139.string().required(),
56662
56721
  createdBy: Joi139.string().hex().optional().allow("", null),
@@ -56675,21 +56734,21 @@ function MSubcategoryPreloved(value) {
56675
56734
  }
56676
56735
  if (value.createdBy && typeof value.createdBy === "string") {
56677
56736
  try {
56678
- value.createdBy = new ObjectId137(value.createdBy);
56737
+ value.createdBy = new ObjectId138(value.createdBy);
56679
56738
  } catch {
56680
56739
  throw new Error("Invalid createdBy ID.");
56681
56740
  }
56682
56741
  }
56683
56742
  if (value.site && typeof value.site === "string") {
56684
56743
  try {
56685
- value.site = new ObjectId137(value.site);
56744
+ value.site = new ObjectId138(value.site);
56686
56745
  } catch {
56687
56746
  throw new Error("Invalid site ID.");
56688
56747
  }
56689
56748
  }
56690
56749
  if (value.category_id && typeof value.category_id === "string") {
56691
56750
  try {
56692
- value.category_id = new ObjectId137(value.category_id);
56751
+ value.category_id = new ObjectId138(value.category_id);
56693
56752
  } catch {
56694
56753
  throw new Error("Invalid category ID.");
56695
56754
  }
@@ -56711,7 +56770,7 @@ import {
56711
56770
  NotFoundError as NotFoundError60,
56712
56771
  useAtlas as useAtlas122
56713
56772
  } from "@7365admin1/node-server-utils";
56714
- import { ObjectId as ObjectId138 } from "mongodb";
56773
+ import { ObjectId as ObjectId139 } from "mongodb";
56715
56774
  function useSubcategoryPrelovedRepo() {
56716
56775
  const db = useAtlas122.getDb();
56717
56776
  if (!db) {
@@ -56726,14 +56785,14 @@ function useSubcategoryPrelovedRepo() {
56726
56785
  } = {}) {
56727
56786
  if (site) {
56728
56787
  try {
56729
- site = new ObjectId138(site);
56788
+ site = new ObjectId139(site);
56730
56789
  } catch {
56731
56790
  throw new BadRequestError218("Invalid site ID format.");
56732
56791
  }
56733
56792
  }
56734
56793
  if (category_id) {
56735
56794
  try {
56736
- category_id = new ObjectId138(category_id);
56795
+ category_id = new ObjectId139(category_id);
56737
56796
  } catch {
56738
56797
  throw new BadRequestError218("Invalid category ID format.");
56739
56798
  }
@@ -56752,7 +56811,7 @@ function useSubcategoryPrelovedRepo() {
56752
56811
  async function getById(_id) {
56753
56812
  let objectId2;
56754
56813
  try {
56755
- objectId2 = new ObjectId138(_id);
56814
+ objectId2 = new ObjectId139(_id);
56756
56815
  } catch {
56757
56816
  throw new BadRequestError218("Invalid subcategory-preloved ID format.");
56758
56817
  }
@@ -56766,14 +56825,30 @@ function useSubcategoryPrelovedRepo() {
56766
56825
  throw error;
56767
56826
  }
56768
56827
  }
56769
- return { getAll, getById };
56828
+ async function addSubcategory(item, session) {
56829
+ const doc = MSubcategoryPreloved(item);
56830
+ try {
56831
+ const res = await collection.insertOne(doc, { session });
56832
+ return res.insertedId;
56833
+ } catch (error) {
56834
+ const isDuplicated = error.message?.includes("duplicate");
56835
+ if (isDuplicated)
56836
+ throw new BadRequestError218("Subcategory already exists.");
56837
+ throw error;
56838
+ }
56839
+ }
56840
+ return { getAll, getById, addSubcategory };
56770
56841
  }
56771
56842
 
56772
56843
  // src/controllers/subcategory-preloved.controller.ts
56773
56844
  import { BadRequestError as BadRequestError219, logger as logger191 } from "@7365admin1/node-server-utils";
56774
56845
  import Joi140 from "joi";
56775
56846
  function useSubcategoryPrelovedController() {
56776
- const { getAll: _getAll, getById: _getById } = useSubcategoryPrelovedRepo();
56847
+ const {
56848
+ getAll: _getAll,
56849
+ getById: _getById,
56850
+ addSubcategory: _addSubcategory
56851
+ } = useSubcategoryPrelovedRepo();
56777
56852
  async function getAll(req, res, next) {
56778
56853
  const schema2 = Joi140.object({
56779
56854
  search: Joi140.string().optional().allow("", null),
@@ -56817,12 +56892,30 @@ function useSubcategoryPrelovedController() {
56817
56892
  return;
56818
56893
  }
56819
56894
  }
56820
- return { getAll, getById };
56895
+ async function addSubcategory(req, res, next) {
56896
+ const { error, value } = schemaSubcategoryPreloved.validate(req.body, {
56897
+ abortEarly: false
56898
+ });
56899
+ if (error) {
56900
+ const messages = error.details.map((d) => d.message).join(", ");
56901
+ logger191.log({ level: "error", message: messages });
56902
+ next(new BadRequestError219(messages));
56903
+ return;
56904
+ }
56905
+ try {
56906
+ const data = await _addSubcategory(value);
56907
+ res.status(201).json(data);
56908
+ } catch (error2) {
56909
+ logger191.log({ level: "error", message: error2.message });
56910
+ next(error2);
56911
+ }
56912
+ }
56913
+ return { getAll, getById, addSubcategory };
56821
56914
  }
56822
56915
 
56823
56916
  // src/models/online-forms-v2.model.ts
56824
56917
  import Joi141 from "joi";
56825
- import { ObjectId as ObjectId139 } from "mongodb";
56918
+ import { ObjectId as ObjectId140 } from "mongodb";
56826
56919
  var FormEntryStatus = /* @__PURE__ */ ((FormEntryStatus2) => {
56827
56920
  FormEntryStatus2["ACTIVE"] = "active";
56828
56921
  FormEntryStatus2["INACTIVE"] = "inactive";
@@ -56877,21 +56970,21 @@ function MFormEntry(value) {
56877
56970
  }
56878
56971
  if (value._id && typeof value._id === "string") {
56879
56972
  try {
56880
- value._id = new ObjectId139(value._id);
56973
+ value._id = new ObjectId140(value._id);
56881
56974
  } catch {
56882
56975
  throw new Error("Invalid ID.");
56883
56976
  }
56884
56977
  }
56885
56978
  if (value.org && typeof value.org === "string") {
56886
56979
  try {
56887
- value.org = new ObjectId139(value.org);
56980
+ value.org = new ObjectId140(value.org);
56888
56981
  } catch {
56889
56982
  throw new Error("Invalid org ID.");
56890
56983
  }
56891
56984
  }
56892
56985
  if (value.site && typeof value.site === "string") {
56893
56986
  try {
56894
- value.site = new ObjectId139(value.site);
56987
+ value.site = new ObjectId140(value.site);
56895
56988
  } catch {
56896
56989
  throw new Error("Invalid site ID.");
56897
56990
  }