@7365admin1/core 2.35.1 → 2.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @iservice365/core
2
2
 
3
+ ## 2.36.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4314116: remove dob entry deprecation upon update
8
+
9
+ ## 2.36.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 5187b6f: get latest changes today
14
+
3
15
  ## 2.35.1
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -24462,7 +24462,7 @@ function MPatrolRoute(value) {
24462
24462
  try {
24463
24463
  value.assignee = value.assignee.map((id) => new import_mongodb65.ObjectId(id));
24464
24464
  } catch {
24465
- throw new import_node_server_utils115.BadRequestError("Invalid _id format");
24465
+ throw new import_node_server_utils115.BadRequestError("Invalid assignee id format");
24466
24466
  }
24467
24467
  }
24468
24468
  if (value.cameras && Array.isArray(value.cameras)) {
@@ -25171,14 +25171,14 @@ function MPatrolLog(value) {
25171
25171
  try {
25172
25172
  value.route = new import_mongodb67.ObjectId(value.route);
25173
25173
  } catch {
25174
- throw new import_node_server_utils118.BadRequestError("Invalid route format");
25174
+ throw new import_node_server_utils118.BadRequestError("Invalid route id format");
25175
25175
  }
25176
25176
  }
25177
25177
  if (value.site && typeof value.site === "string") {
25178
25178
  try {
25179
25179
  value.site = new import_mongodb67.ObjectId(value.site);
25180
25180
  } catch {
25181
- throw new import_node_server_utils118.BadRequestError("Invalid site format");
25181
+ throw new import_node_server_utils118.BadRequestError("Invalid site id format");
25182
25182
  }
25183
25183
  }
25184
25184
  const assignee = (value.assignee || []).map((id) => {
@@ -25192,7 +25192,7 @@ function MPatrolLog(value) {
25192
25192
  try {
25193
25193
  value.incidentReport.id = new import_mongodb67.ObjectId(value.incidentReport.id);
25194
25194
  } catch {
25195
- throw new import_node_server_utils118.BadRequestError("Invalid incident report format");
25195
+ throw new import_node_server_utils118.BadRequestError("Invalid incident report id format");
25196
25196
  }
25197
25197
  }
25198
25198
  return {
@@ -26623,7 +26623,7 @@ function MServiceProviderBilling(value) {
26623
26623
  try {
26624
26624
  value.orgId = new import_mongodb71.ObjectId(value.orgId);
26625
26625
  } catch {
26626
- throw new Error("Invalid ID.");
26626
+ throw new Error("Invalid org ID.");
26627
26627
  }
26628
26628
  }
26629
26629
  return {
@@ -28987,14 +28987,14 @@ function MBillingItem(value) {
28987
28987
  try {
28988
28988
  value.site = new import_mongodb79.ObjectId(value.site);
28989
28989
  } catch {
28990
- throw new import_node_server_utils137.BadRequestError("Invalid site format");
28990
+ throw new import_node_server_utils137.BadRequestError("Invalid site id format");
28991
28991
  }
28992
28992
  }
28993
28993
  if (value.org && typeof value.org === "string") {
28994
28994
  try {
28995
28995
  value.org = new import_mongodb79.ObjectId(value.org);
28996
28996
  } catch {
28997
- throw new import_node_server_utils137.BadRequestError("Invalid org format");
28997
+ throw new import_node_server_utils137.BadRequestError("Invalid org id format");
28998
28998
  }
28999
28999
  }
29000
29000
  if (value.units && Array.isArray(value.units)) {
@@ -29351,21 +29351,21 @@ function MBillingConfiguration(value) {
29351
29351
  try {
29352
29352
  value.site = new import_mongodb81.ObjectId(value.site);
29353
29353
  } catch {
29354
- throw new import_node_server_utils139.BadRequestError("Invalid site format");
29354
+ throw new import_node_server_utils139.BadRequestError("Invalid site id format");
29355
29355
  }
29356
29356
  }
29357
29357
  if (value.org && typeof value.org === "string") {
29358
29358
  try {
29359
29359
  value.org = new import_mongodb81.ObjectId(value.org);
29360
29360
  } catch {
29361
- throw new import_node_server_utils139.BadRequestError("Invalid org format");
29361
+ throw new import_node_server_utils139.BadRequestError("Invalid org id format");
29362
29362
  }
29363
29363
  }
29364
29364
  if (value.createdBy && typeof value.createdBy === "string") {
29365
29365
  try {
29366
29366
  value.createdBy = new import_mongodb81.ObjectId(value.createdBy);
29367
29367
  } catch {
29368
- throw new import_node_server_utils139.BadRequestError("Invalid createdBy format");
29368
+ throw new import_node_server_utils139.BadRequestError("Invalid createdBy id format");
29369
29369
  }
29370
29370
  }
29371
29371
  return {
@@ -30783,35 +30783,35 @@ function MUnitBilling(value) {
30783
30783
  try {
30784
30784
  value.site = new import_mongodb85.ObjectId(value.site);
30785
30785
  } catch {
30786
- throw new import_node_server_utils148.BadRequestError("Invalid site format");
30786
+ throw new import_node_server_utils148.BadRequestError("Invalid site id format");
30787
30787
  }
30788
30788
  }
30789
30789
  if (value.org && typeof value.org === "string") {
30790
30790
  try {
30791
30791
  value.org = new import_mongodb85.ObjectId(value.org);
30792
30792
  } catch {
30793
- throw new import_node_server_utils148.BadRequestError("Invalid org format");
30793
+ throw new import_node_server_utils148.BadRequestError("Invalid org id format");
30794
30794
  }
30795
30795
  }
30796
30796
  if (value.paidBy && typeof value.paidBy === "string") {
30797
30797
  try {
30798
30798
  value.paidBy = new import_mongodb85.ObjectId(value.paidBy);
30799
30799
  } catch {
30800
- throw new import_node_server_utils148.BadRequestError("Invalid paidBy format");
30800
+ throw new import_node_server_utils148.BadRequestError("Invalid paidBy id format");
30801
30801
  }
30802
30802
  }
30803
30803
  if (value.billItem && typeof value.billItem === "string") {
30804
30804
  try {
30805
30805
  value.billItem = new import_mongodb85.ObjectId(value.billItem);
30806
30806
  } catch {
30807
- throw new import_node_server_utils148.BadRequestError("Invalid billItem format");
30807
+ throw new import_node_server_utils148.BadRequestError("Invalid billItem id format");
30808
30808
  }
30809
30809
  }
30810
30810
  if (value.unitId && typeof value.unitId === "string") {
30811
30811
  try {
30812
30812
  value.unitId = new import_mongodb85.ObjectId(value.unitId);
30813
30813
  } catch {
30814
- throw new import_node_server_utils148.BadRequestError("Invalid unitId format");
30814
+ throw new import_node_server_utils148.BadRequestError("Invalid unitId id format");
30815
30815
  }
30816
30816
  }
30817
30817
  return {
@@ -31076,18 +31076,16 @@ function useSiteUnitBillingRepo() {
31076
31076
  const endDate = new Date(dateTo);
31077
31077
  endDate.setHours(23, 59, 59, 999);
31078
31078
  dateExpr = {
31079
- $expr: {
31080
- $and: [
31081
- { $gte: ["$issueDate", startDate] },
31082
- { $lte: ["$issueDate", endDate] }
31083
- ]
31079
+ issueDate: {
31080
+ $gte: startDate,
31081
+ $lte: endDate
31084
31082
  }
31085
31083
  };
31086
31084
  }
31087
31085
  const query = {
31088
31086
  status,
31089
- ...import_mongodb86.ObjectId.isValid(unitId) && { unitId: new import_mongodb86.ObjectId(unitId) },
31090
- ...import_mongodb86.ObjectId.isValid(site) && { site: new import_mongodb86.ObjectId(site) },
31087
+ ...unitId && import_mongodb86.ObjectId.isValid(unitId) && { unitId: new import_mongodb86.ObjectId(unitId) },
31088
+ ...site && import_mongodb86.ObjectId.isValid(site) && { site: new import_mongodb86.ObjectId(site) },
31091
31089
  ...dateExpr
31092
31090
  };
31093
31091
  try {
@@ -37188,16 +37186,13 @@ function useStatementOfAccountService() {
37188
37186
  if (user) {
37189
37187
  value.createdByName = user.name;
37190
37188
  }
37191
- let unit_billings = await getUnitBillingBySite(
37192
- {
37193
- status: "active",
37194
- site: value.site.toString() ?? "",
37195
- dateFrom,
37196
- dateTo,
37197
- unitId: value.unitId?.toString() ?? ""
37198
- },
37199
- session
37200
- );
37189
+ let unit_billings = await getUnitBillingBySite({
37190
+ status: "active",
37191
+ site: value.site.toString() ?? "",
37192
+ dateFrom,
37193
+ dateTo,
37194
+ unitId: value.unitId?.toString() ?? ""
37195
+ });
37201
37196
  if (!unit_billings || unit_billings.length === 0) {
37202
37197
  return unit_billings;
37203
37198
  }
@@ -40701,8 +40696,7 @@ function useOccurrenceEntryService() {
40701
40696
  updateOccurrenceEntryById: _updateOccurrenceEntryById,
40702
40697
  getOccurrenceEntryById: _getOccurrenceEntryById,
40703
40698
  getOccurrenceEntryByBookId: _getOccurrenceEntryByBookId,
40704
- updateOccurrenceEntryByBookId: _updateOccurrenceEntryByBookId,
40705
- deleteOccurrenceEntryById: _deleteOccurrenceEntryById
40699
+ updateOccurrenceEntryByBookId: _updateOccurrenceEntryByBookId
40706
40700
  } = useOccurrenceEntryRepo();
40707
40701
  const {
40708
40702
  getOccurrenceBookById: _getOccurrenceBookById,
@@ -40778,7 +40772,6 @@ function useOccurrenceEntryService() {
40778
40772
  totalInput: book.totalInput + 1
40779
40773
  });
40780
40774
  await _add(value);
40781
- await _deleteOccurrenceEntryById(id);
40782
40775
  await session?.commitTransaction();
40783
40776
  return "Successfully updated daily occurrence entry.";
40784
40777
  } catch (error) {