@7365admin1/core 3.43.0 → 3.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/core
2
2
 
3
+ ## 3.44.0
4
+
5
+ ### Minor Changes
6
+
7
+ - adbcf07: block, level, units upload modifications
8
+
3
9
  ## 3.43.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -4003,7 +4003,7 @@ declare function MVisitorTransaction(value: TVisitorTransaction): {
4003
4003
  declare const visitors_namespace_collection = "visitor.transactions";
4004
4004
  declare function useVisitorTransactionRepo(): {
4005
4005
  add: (value: TVisitorTransaction, session?: ClientSession, returnValue?: boolean) => Promise<any>;
4006
- getAll: ({ search, page, limit, sort, status, org, site, dateTo, dateFrom, type, checkedOut, plateNumber, tab, }: {
4006
+ getAll: ({ search, page, limit, sort, status, org, site, dateTo, dateFrom, type, checkedOut, plateNumber, tab, passOrKey, }: {
4007
4007
  search?: string | undefined;
4008
4008
  page?: number | undefined;
4009
4009
  limit?: number | undefined;
@@ -4017,6 +4017,10 @@ declare function useVisitorTransactionRepo(): {
4017
4017
  checkedOut?: Boolean | undefined;
4018
4018
  plateNumber?: string | undefined;
4019
4019
  tab?: string | undefined;
4020
+ passOrKey?: {
4021
+ keyId: string;
4022
+ type: string;
4023
+ } | undefined;
4020
4024
  }) => Promise<{
4021
4025
  items: any[];
4022
4026
  pages: number;
package/dist/index.js CHANGED
@@ -22369,7 +22369,8 @@ function useVisitorTransactionRepo() {
22369
22369
  type = "",
22370
22370
  checkedOut,
22371
22371
  plateNumber = "",
22372
- tab = ""
22372
+ tab = "",
22373
+ passOrKey
22373
22374
  }) {
22374
22375
  page = page > 0 ? page - 1 : 0;
22375
22376
  const skip = page * limit;
@@ -22400,7 +22401,9 @@ function useVisitorTransactionRepo() {
22400
22401
  },
22401
22402
  ...plateNumber && { plateNumber },
22402
22403
  ...status && { status },
22403
- ...tab == "Overnight Parking" && { isOvernightParking: true }
22404
+ ...tab == "Overnight Parking" && { isOvernightParking: true },
22405
+ ...passOrKey?.type == "pass" && { visitorPass: { $elemMatch: { keyId: new import_mongodb44.ObjectId(passOrKey.keyId) } } },
22406
+ ...passOrKey?.type == "key" && { passKeys: { $elemMatch: { keyId: new import_mongodb44.ObjectId(passOrKey.keyId) } } }
22404
22407
  };
22405
22408
  const finalSort = Object.keys(sort).length > 0 ? sort : { latestDate: -1 };
22406
22409
  try {
@@ -31339,7 +31342,7 @@ function useBuildingController() {
31339
31342
  const requiredFields = ["block", "name"];
31340
31343
  const rowSchema = import_joi48.default.object({
31341
31344
  block: import_joi48.default.number().integer().min(0).required(),
31342
- name: import_joi48.default.string().trim().required(),
31345
+ name: import_joi48.default.alternatives().try(import_joi48.default.string(), import_joi48.default.number()).custom((value) => String(value).trim()).required(),
31343
31346
  level: import_joi48.default.alternatives().try(import_joi48.default.string(), import_joi48.default.number()).custom((value) => String(value)).optional().allow(null, ""),
31344
31347
  unit: import_joi48.default.alternatives().try(import_joi48.default.string(), import_joi48.default.number()).custom((value) => String(value)).optional().allow(null, ""),
31345
31348
  category: import_joi48.default.string().trim().optional().allow(null, ""),
@@ -39215,7 +39218,20 @@ function useVisitorTransactionController() {
39215
39218
  checkedOut: import_joi58.default.boolean().allow(null, ""),
39216
39219
  plateNumber: import_joi58.default.string().optional().allow(null, ""),
39217
39220
  order: import_joi58.default.string().valid(...Object.values(SortOrder)).default("asc" /* ASC */),
39218
- tab: import_joi58.default.string().optional().allow(null, "")
39221
+ tab: import_joi58.default.string().optional().allow(null, ""),
39222
+ passOrKey: import_joi58.default.alternatives().try(
39223
+ import_joi58.default.object({
39224
+ keyId: import_joi58.default.string().regex(/^[0-9a-fA-F]{24}$/).required(),
39225
+ type: import_joi58.default.string().required()
39226
+ }),
39227
+ import_joi58.default.string().custom((value2, helpers) => {
39228
+ try {
39229
+ return JSON.parse(value2);
39230
+ } catch (e) {
39231
+ return helpers.error("any.invalid");
39232
+ }
39233
+ })
39234
+ ).optional().allow(null)
39219
39235
  });
39220
39236
  const { error, value } = validation.validate(req.query, {
39221
39237
  abortEarly: false
@@ -39240,7 +39256,8 @@ function useVisitorTransactionController() {
39240
39256
  sort,
39241
39257
  order,
39242
39258
  plateNumber,
39243
- tab
39259
+ tab,
39260
+ passOrKey
39244
39261
  } = value;
39245
39262
  const sortObj = {
39246
39263
  [sort ? sort : "_id" /* ID */]: order === "asc" /* ASC */ ? 1 : -1
@@ -39258,7 +39275,8 @@ function useVisitorTransactionController() {
39258
39275
  type,
39259
39276
  checkedOut,
39260
39277
  plateNumber,
39261
- tab
39278
+ tab,
39279
+ passOrKey
39262
39280
  });
39263
39281
  res.status(200).json(data);
39264
39282
  return;